Forum Moderators: open

Message Too Old, No Replies

Dealing with pages opening outside of frames

         

Marcia

10:15 am on Mar 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A page listed at search engines, when clicked on, opens individually, outside the frames. When clicking on the text links bottom of the page, the other pages also open outside the frames.

Is there any code which, though the individual pages will have the search engine listings, will cause the pages to open up inside the frameset?

joshie76

10:25 am on Mar 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tricky...

You could have script on each pagelet that checks to see if the parent window is your frameset

if (window.top.location != 'frames.htm') 
{
window.top.location = 'frames.htm'
}

But that would always take them to the homepage, which you don't want when people have found the page they want at the SE. So you could set up some kind of querystring system.

if (window.top.location != 'frames.htm') 
{
window.top.location = 'frames.htm?goto=' + escape(window.self.location);
}

Your frameset would then have to handle substituting the content page for the one passed in the querystring. Can be a bit of nightmare and I guess most people would probably tell you to avoid it.

tedster

4:33 pm on Mar 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's some code that works according to Joshie's scheme in the generic javascript thread [webmasterworld.com]. Look for the post with the title "Forcing Many Pages Into Frames".

I think this code handles the situation pretty well -- you need one extra version of the frameset page to "catch" any orhpaned page hits and put them with their parents.