Welcome to WebmasterWorld Guest from 50.19.34.234

Forum Moderators: open

Message Too Old, No Replies

Javascript: putting a frames page back into its frameset

frames top location

     

elfeste

6:14 pm on Aug 10, 2003 (gmt 0)

10+ Year Member



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?

sullen

6:19 pm on Aug 10, 2003 (gmt 0)

10+ Year Member



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.

tedster

6:29 pm on Aug 10, 2003 (gmt 0)

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



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.

<added>
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.
</added>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month