Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

help using js to keep frameset



1:03 pm on Mar 20, 2003 (gmt 0)

10+ Year Member

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.


5:17 pm on Mar 20, 2003 (gmt 0)

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

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.


11:43 am on Mar 21, 2003 (gmt 0)

10+ Year Member

Thanks tedster!

I'll get right on it.



Featured Threads

Hot Threads This Week

Hot Threads This Month