Ok so the code I had tried for this just isn't working right. So basically all i need is to insert the current page url in a link I was using document.location.href with several methods.
| SitePoint Sponsor |
Ok so the code I had tried for this just isn't working right. So basically all i need is to insert the current page url in a link I was using document.location.href with several methods.
Code HTML4Strict:<a id="current" href="#">Link</a> <script type="text/javascript"> document.getElementById('current').href=location.href; </script>
Saul
Ok yes that is a much better than what I was trying but I need to put this in a existing link... the url would be something like http://www.mysite.com/go.php?var="the current page url". Thanks
Something like this?
Code HTML4Strict:<script type="text/javascript"> document.getElementById('current').href='http://www.mysite.com/go.php?var='+escape(location.href); </script>
Saul
thanks for your help that worked perfectly
Bookmarks