homepage Welcome to WebmasterWorld Guest from 54.167.11.16
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Force out of context pages into frame with JavaScript
ukgimp




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

Hello

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.

Cheers

 

toadhall




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

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.

larryP




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

I would insert this script into the child pages:

<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!-- HIDE SCRIPT FROM OLDER BROWSERS
var passpage = document.URL
if (top.location == self.location) {
top.location.replace('master.html?' + passpage);
}
//-->
</SCRIPT>

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved