Forum Moderators: open

Message Too Old, No Replies

Frames help!

         

Zippinger

3:16 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



Hi
Let it be said that I´m a total newbie, now there.
I made a webpage that uses frames. My problem is that if surfers access it via a serch engine, and hit the individual.html pages, it´s all they see, and not the content, or navigation buttons! I have tried several scripts found on the web, but had no success so far, forcing the index.html to appear instead, which is what I am looking for.

Anyone here who can help?

Thanks in advance.

Z

tedster

3:42 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, Zippinger.

Check out message #21 in this thread:

[webmasterworld.com...]

It's a javascript approach to putting orphaned pages back into their parent frameset. It's even better than sending each visitor to the original index, because it gives them the page that has the keywords that were involved in their search, but with the full frameset.

If you just want to send everyone to your original index page, all you usually need is this in the <head> section:

<script type="text/javascript>
if (top.location == self.location)
top.location.href="index.html"
</script>

Zippinger

5:23 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



Hey

Thanks for the help.

I tried your small script, but I doubt I cut and paste it correctly (I´m hopeless!) I DO place it inside the Head section, as is, however I can not make it work.

I have an index.html, top.html, and then a few content
pages. (Should the script be pasted into all pages including top.html?) -I tried it on the top, and uploaded it to the web, still the top.html can be loaded without a content page, which was what I would like to avoid. :/

About the master thing, I have no clue of how to do that, I´m sorry.

Zippinger

5:42 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



Is this pasted correctly, in the top.html?:

<html>

<head>
<script type="text/javascript>
if (top.location == self.location)
top.location.href="index.html"
</script>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Microsoft FrontPage 4.0">
<title>top</title>
<link rel="stylesheet" href="style.css">
</head>

<body bgcolor="#f5f5f5" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" bgcolor="white">
[snipped]

tedster

5:48 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that looks OK to me. If you ask for top.html in your browser that should load index.html instead -- which I assume is your basic frameset

Are you seeing no change? That baffles me. By any chance do you have javascript or "automatic redirection" turned off in your browser?

jimbeetle

6:08 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For what it's worth, on one almost forgotten framed site I have my 'put it in the right frame' script between the head and body:

</head>

<script type blah blah>
</script>

<body>

On all other sites I have a frame breaker in the body:

<body onload="if (self!= top) top.location = self.location">

So you might try something along this line:

<body onload="if (top.location == self.location) top.location.href='index.html'">

Haven't tested it and not sure if the 's have to be escaped, but there're are sure to be js folk around.

And welcomg to WW, Zippinger.

Zippinger

6:09 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



RE:Are you seeing no change? nope, none..

RE:By any chance do you have javascript or "automatic redirection" turned off in your browser?

-Autom. redir. is turned on, I´m not sure about the java script, I think it is on, since the menu stuff works ok, cuz I believe it´s Java "driven".

tedster

6:16 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Now I see it - stupid error on my part. We're missing a close quote!

Should be

<script type="text/javascript">
if (top.location == self.location)
top.location.href="index.html"
</script>

Zippinger

6:43 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



Thanks bunches Ted! -The top are now forced to the index page.. Excellent :D!

--
What if I apply this little script on content pages that are stored in another folder, what should I add in order to make it work?

tedster

9:14 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Fust change the path to index.html to the correct path