Home Frames Orphan Pages Give Orphan Pages A Home
Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Give Orphan Pages A Home

This script first checks to see if your content page is trying to display outside its frameset. If so, it redirects your visitor to a framed page and loads the orphan into an alternative frameset that you design. Visitors see the page they expect - in a format that allows them to navigate easily to other pages within the site.

As an added benefit, this is a framed page that visitors can bookmark!.

Insert this code into the HEAD section of each page that should always display inside a frameset:

Then, create a new page and name it master.html. Leave the BODY section empty and place this code inside the HEAD section:

Note that this script creates a frameset that allots 20% of the frame size to the left frame and 80% to the right frame. You can adjust these as needed to accommodate your site.

Debugging And Maintenance

Even simple JavaScript code can cause debugging headaches. If your script doesn't seem to work properly, check these things first:

  • Spelling errors. Carefully check to see that the file names are spelled exactly the same. If you call the master frameset "master.html" in the JavaScript, but name it "Master.html", you'll get an error. Name your files and variables anything you want (other than reserved words), but you have to be consistent.

  • File paths. Check your file paths carefully when you test the pages offline. Netscape browsers are notoriously picky about paths. Then check them again - and edit if necessary - when you upload the pages to a live server.

  • Avoid line breaks. Don't insert line breaks in the document.write statement or JavaScript will assume that you have incorrectly terminated the statement.