Chapter Wrap Up & Review

In this chapter, I have acquired a good understand about these JavaScript commands:

Object Method Properties
document write() alinkColor, bgColor, fgColor, linkColor, lastModified, location, referrer, title, vlinkColor
history length
location host, hostname
navigator appCodeName, appName, appVersion, userAgent

Question:

What does this script do?

<SCRIPT LANGUAGE="javascript">
document.write("Go <A HREF=" +document.referrer+ ">back</A> one page.")
</SCRIPT>

Answer:

The script returns the above link. It's kind of awesome how the script returns different results, depending on where this document is saved!

If I run the script from my computer's hard drive, clicking on the "back" link will always take me to the folder that this file resides in, regardless of how I linked to the page. History is totally irrelevant. All I get is the directory listing of files in that folder, including index.html.

After uploading this page to my Geocities website, clicking on the "back" link takes me back to whichever page I was on previously. When I enter the Geocities URL of this page directly into the browser (there is no history of previous visits), clicking on the "back" link takes me to the folder that this document resides in and then the browser opens the index.html file from there. So cool!

BackTable of ContentsNext