Hi,
Got a small JavaScript problem. I cannot print out a JavaScript variable the way I would like. For example...
This prints out the variable just fine:
This, however, does not:Code:<html> <head> <script language="JavaScript"> var url = "http://www.somesite.com"; </script> </head> <body> <script language="JavaScript">document.write(url);</script> </body> </html>
As you can see, I want to be able to specify a URL with JavaScript, and then use it in a link's HREF attribute later...I cannot get it to function correctly, however. Any ideas?Code:<html> <head> <script language="JavaScript"> var url = "http://www.somesite.com"; </script> </head> <body> <a href="<script language='JavaScript'>document.write(url);</script>"> </body> </html>






Bookmarks