Hi nikola8,
If you are using an HTML doctype you can do this:
Code:
<script type='text/javascript'>
document.write(
"<script type='text/javascript' src='myscript.php?url=" + encodeURIComponent(window.location.href) + "'><\/script>"
);
</script>
You can do this for either HTML or XHTML doctypes:
Code:
<script type='text/javascript'>
(function() {
var scr = document.createElement('script');
scr.type = 'text/javascript'; // is your php file returning Js?
scr.src = 'myscript.php?url=' + encodeURIComponent(window.location.href);
document.getElementsByTagName('head')[0].appendChild(scr);
})();
</script>
Bookmarks