This is a simple page to demonstrate some of the ideas, problems and solutions discussed on my page about frames.

This page is to demonstrate how to rebuild a frameset around "orphaned" pages.

In all the examples below the xxxxxxxx in the code below has been replaced with frmset2a.htm, frmset2b.htm, frmset2c.htm or frmset2d.htm which are the controlling frameset pages for frmmain2a.htm, frmmain2b.htm, frmmain2c.htm and frmmain2d.htm. When the links to to the test pages are clicked on, a page will open in a new browser window. The frameset will automatically reload itself in that window.

Put this code in the HEAD section of the pages that should appear within a frameset.

<script language="JavaScript">
<!--
Hide from old browsers
if (top == self) self.location.href = "xxxxxxxx";
// Stop hiding from old browsers -->
</script>

Replace xxxxxxxx with the name of the page that contains the frameset information.

Open frmmain2a.htm using the above code

Alternatively, you could use...

<script language="JavaScript">
<!-- Hide from old browsers
if (parent.location.href == self.location.href) window.location.href = "xxxxxxxx";
// Stop hiding from old browsers -->
</script>

Again, replace xxxxxxxx with the name of the page that contains the frameset information.

Open frmmain2b.htm using the above code

Another code you can use is...

<script language="JavaScript">
<!-- Hide from old browsers
if(top.location==self.location) top.location.href="xxxxxxxx";
// Stop hiding from old browsers -->
</script>

Again, replace xxxxxxxx with the name of the page that contains the frameset information.

Open frmmain2c.htm using the above code

If you are using Lycos Europe servers the above codes won't work. This is because the Lycos/Google ad-frame they use changes the parent, top and self location identifiers. The following code should be used instead. The code also works in IE 6.0.29 on the other servers I've tried it on, including my own.

<script language=JavaScript>
<!-- Hide from old browsers

if( !parent.frames["yyyyyyyy"])parent.location.href("xxxxxxxx");
// Stop hiding from old browsers -->
</script>

In the above code replace yyyyyyyy with the name of the frame you're testing for and replace xxxxxxxx with the name of the page that you're looking for.

Open frmmain2d.htm using the above code

 

There are problems with some of these codes depending on what server and browser you're using. The workability of the codes are summarized in the following table.

  Lycos Brisray 0Catch
IE 6.0.29 D only All All
Mozilla 1.7.3 None Not D Not D
Netscape 7.2 None Not D Not D
Opera 7.54 Not D Not D Not D
WebTV None Not D Not D

For Lycos servers, I'd suggest that you can combine some of the lines of JavaScript and use...

<script language="JavaScript">
<!-- Hide from old browsers
if (top == self) self.location.href = "xxxxxxxx";
if( !parent.frames["yyyyyyyy"])parent.location.href("xxxxxxxx");
// Stop hiding from old browsers -->
</script>

The code will work for those using IE 6.0.29 and Opera 7.54.

This page created 29th October 2004, last modified 31st October 2004


GoStats stats counter