Frames and redirect script

G

Gordon

Hi,

About a year ago, Stefan B Rusynko kindly gave me the following JavaScript
to add to my framed pages, to redirect people to my home page if they got a
link to a framed page:

<title>Your Page Title</title>
<script language="JavaScript" language="JavaScript"><!-- Hide It:
// Show Page Title in Window Bar
if (top != self) top.document.title = document.title;
// Show Status Bar Text
defaultStatus = "Whatever you want - including the URL";
// Send to home frameset page if not in Frames
if (parent.location.href == self.location.href) {
alert("Please view our site in our Frames");
window.location.href = 'http://www.yourdomain.com/index.htm';
} else { // Already In frames
}
// ShowIt: --></script>


It works perfectly in almost all circumstances, and I thank Stefan for it.

But when the page is reached through some Search Engines, (eg
http://www.bbc.co.uk/ , and other Inktomi SE's like www.hotbot.com) none of
the internal links in the contents frame work, continually returning the
visitor to the home page. The script works in all other cases.

I've added a separate navigation structure to the bottom of each framed page
to partly alleviate the problem, but would obviously like the main
navigation links in the contents frame to work.

The site is www.crete-direct.com , and a search in http://www.bbc.co.uk/)
for "villas crete" (without the quotes) will find it in position No 2.

Any ideas?

Thanks

Gordon
 
T

Thomas A. Rowe

Gordon,

Following the link from http://www.bbc.co.uk/ all of the links appear to
work correctly from side and the bottom, in IE6 under Windows XP Home, all
updates.

In NS4.08 and NS6.21 I see the problem as you have indicated.

Very nice site. However I think your site would work equally as well, if not
better, if you get rid of the frameset.

However, if you want to keep the frames, then you may need to try a
different JavaScript, see if the following works better:

http://www.echoecho.com/jsframes.htm

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
G

Gordon

Thomas A. Rowe said:
Gordon,

Following the link from http://www.bbc.co.uk/ all of the links appear to
work correctly from side and the bottom, in IE6 under Windows XP Home, all
updates.

In NS4.08 and NS6.21 I see the problem as you have indicated.

Very nice site. However I think your site would work equally as well, if not
better, if you get rid of the frameset.

However, if you want to keep the frames, then you may need to try a
different JavaScript, see if the following works better:

http://www.echoecho.com/jsframes.htm


Thomas...

Thanks for following through the problem - I shall try the other script and
see what happens!

Gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top