Un-Frame Me!
To keep a page from getting stuck in a frame, include a simple if statement that tests to see if the parent (frameset page) or top (file reflected in the browser's location field) is equal to the page itself. If it is not equal, set it equal!
if(parent!=self){
parent.location=self.location
}
Or, if you are dealing with a frameset within a frameset:
if(top!=self){
top.location=self.location
}
Because top refers to the page referenced in the browser's location field, and parent refers to the frameset page, and they aren't always the same thing, use top if you know you don't want to be in any kind of frameset whatsoever.

For those of you creating a JavaScript navigation system for your library, if you have a frameset page referenced in your scripts array, you'll want to place this un-frame script in the files previous to and directly after your frameset page as referenced in your array. This will keep those pages from getting stuck in the frameset while navigating through your library.



 


View Source | Home | Contact