Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Force out of context pages into frame with JavaScript

2:21 pm on Apr 26, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


Is it possible to insert a java script into pages within a frameset that forces them to reload in context if they are requested without the framset.

If yes, anybody know this or where i can find this out.


3:43 pm on Apr 26, 2002 (gmt 0)

10+ Year Member

Is this what you're looking for?

[webmasterworld.com ]
...2/3 the way down.

NB - The code is missing semicolons at the end of lines and curly braces from the conditional statement.

7:32 pm on Apr 26, 2002 (gmt 0)

10+ Year Member

I would insert this script into the child pages:

var passpage = document.URL
if (top.location == self.location) {
top.location.replace('master.html?' + passpage);

then add code to the main frameset to parse the URL after the ? to extract the link and write that page into the content frame, like the link toadhall posted. Using the location.replace method instead of location.href will avoid breaking the browsers back button.