Forum Moderators: open
Anyone here who can help?
Thanks in advance.
Z
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>
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.
<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]
</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.