homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

help using js to keep frameset

10+ Year Member

Msg#: 317 posted 1:03 pm on Mar 20, 2003 (gmt 0)

Hi all,

Please help, I want users of the site I am working on to stay within the frames that have been set out.

I use js to detect whether the current html document is within a frame. If not they are redirected to the page containing the frameset which will then display the page but within a frame.

I have tried using 'document.referrer' and 'history.previous' to get the source for the new frame but without any success.

I think that document.referrer only returns a value when a href link has been used. is this true? Also, history.previous returns 'undefined' even though the previous page is in the browsers history.

Thankyou all in advance, Pip.



WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 317 posted 5:17 pm on Mar 20, 2003 (gmt 0)

Welcome to WebmasterWorld, plofm

There's a full strategy in our generic javascript thread [webmasterworld.com], message 21 - "Force Many Pages Into Frames."

Rather than using the history object, it uses a query string to pass on the URL of the original page. It also uses a second, "utilty" version, of the frameset, one that's been scripted to accept that query string and put the page into it's appropriate spot.

The only thing you'll need to customize is the exact dimenions and number of frames in yourn particular frameset.


10+ Year Member

Msg#: 317 posted 11:43 am on Mar 21, 2003 (gmt 0)

Thanks tedster!

I'll get right on it.


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