homepage Welcome to WebmasterWorld Guest from
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

Javascript: putting a frames page back into its frameset
frames top location

10+ Year Member

Msg#: 526 posted 6:14 pm on Aug 10, 2003 (gmt 0)

I am trying to build a website using frames.
There are 3 frames called top,navbar and window

I can use links from the navbar frame to open new pages in the window frame ok.

The problem is that I want all the pages that appear in the window frame indexed by the search engine robots when they come a calling but when someone clicks on a link to come to a window page I want it loaded in its window frame with top and navbar frames in place.

I have tried

if (window == top) top.location.href ="index.htm";
but this has no effect. The frameset info is contained in index.htm

Any suggestions?



10+ Year Member

Msg#: 526 posted 6:19 pm on Aug 10, 2003 (gmt 0)

you would be wanting this:

if (top == self) {self.location.href = "index.htm"}

I don't think it's a great idea to call one of your frames "top" though as it could cause problems.


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

Msg#: 526 posted 6:29 pm on Aug 10, 2003 (gmt 0)

Welcome to WebmasterWorld, elfeste.

I think we have just the thing you need. Check our Generic Javascript thread [webmasterworld.com] and go to Message #21, "FORCE MANY PAGES INTO FRAMES with one simple script"

This script was written for a 2-frame frameset, but it's simple to adapt to your situation - just change the document.write line to write out your frameset configuration. Nothing else needs to be changed.

The advantage this script has over sullen's solution
(which also works) is that your visitors from the search
engines can get your frameset with the particular page
they clicked on already loaded -- instead of the "default"
configuration of index.html.

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