Return to Robert's and Laura's Elaborations Pirate Recipes Pirate Songs Treasure Maps Jolly Roger Flags (new window) |
Welcome to the September/October elaborations for Laura's and Robert's 'Under the Hood' column in MacToday magazine! This article attempted to give an example of a JavaScript on a web page which created a link on the fly, based on the referring web page. All though this may seem like a useless exercise, there are actually times when this might come in handy. You might have distinct areas of a web site for which you don't want to have the navigation cross within these areas. Within each of these areas you might want to share a document. Well, when you share the document, you've got to return the 'browser' back to where they came from, This means that either you can either: 1) Duplicate the document for each area and create the proper navigation back to where the browser came from. This is can be a little or gigantic maintenance headache. ...or... 2) Create the navigation on the fly, returning the user to where them came from! To experiment, click on any of the 'Our Links' links to the left. You'll be taken to a page which refers to a page for 'Landlubber Links.' When you get there, you'll notice that the link changes based on whether you arrived from 'Recipes,' 'Songs,' or 'Maps.' If you would like to grab the JavaScript, just save the source code for the 'LandLubber links' page. Good Luck, and let me know if you have problems or comments. |