Assignment 7: A Possible Answer

This could have been done a couple of ways, but here's how I did it:

...and here's the script that made it:

<SCRIPT type="text/javascript">

var dr = location.host;
document.write("<A HREF=http://" +dr+ "/primers/jsp>Click Here for JavaScript Primers</A>")

</SCRIPT>

Keep in mind though, this page has to be on a server to work. If the page is on the hard drive, then there's no "location.host".

Let's say you wanted to create a link that returns the person one page before this one. Same format, just use the "document.referrer" statement. Are you starting to see the use of these things? Good.

Close this window to return to JavaScript Primer #1