Page Location
Sometimes you want to create a template that will write the location of the current web document (as you see in the upper-right corner). This is relatively easy to do with JavaScript. Here are the lines of code; play around with them and see what you can do. Just place these lines of code somewhere in your HTML document:
<script language="JavaScript">
document.write(location.hostname + "<br />");
document.write(location.href + "<br />");
document.write(location.pathname + "<br />");
</script>
|
The above lines of code will create the following display:
gregcklotz.com https://gregcklotz.com/English313/js-pagelocation.html /English313/js-pagelocation.html
|
|