CodeAve.com CodeAve.com - JavaScript - Document Info
ASP
JavaScript
·Document Info
·Forms
·Images
·Miscellaneous
·Navigation
·Script Writers
·Contents
·What's New?
CSS
HTML
Links
Mail List
Search
Sitemap


 


Current Page URL
Just like the X on a map that marks “You Are Here” location.href will tell you the exact location of the current document in the browser. This can be particularly useful when building links that refer back to the current page and you’re not too sure what to name it just yet. The following will demonstrate writing the url back to the browser and a hyperlink to the current document.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com (JavaScript: Current Page URL)</title>
<body bgcolor="#FFFFFF">

<script language="JavaScript">
<!-- 

document.write (location.href)
document.write ("<p>")
document.write ("<a href='"+location.href+"'>Link To Current Page</a>")

// -->
</script>

</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Links | Search Engine db |  Privacy Statement |  Advertising Rates |  Email

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2010 CodeAve.com
All Rights Reserved