Welcome to WebmasterWorld Guest from 54.167.58.159

Forum Moderators: open

Message Too Old, No Replies

Reading url using javascript

     

vikasvrao

7:35 pm on Sep 24, 2009 (gmt 0)

5+ Year Member



Hi guys,
I'm trying to read the URL of the page using javascript, this is what I am trying and it doesnt work.

<a href="JavaScript:document.write(window.location.href);"
style="text-decoration:none;">
<img src="images/socialicons/Icons/facebook.png"
style="vertical-align: middle;" alt="Facebook"
title="share on Facebook" /> Facebook
</a>

Can someone please tell me how to do this right?

Thank you.

rainborick

8:14 pm on Sep 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try replacing the first line with:

<script type="text/javascript>
document.write('<a href="' +
window.location.href + '" style="text-decoration:none;">');
</script>
 

Featured Threads

Hot Threads This Week

Hot Threads This Month