I tend to put this js statements in my pages:
if (self != top) {
open(self.location.href);
history.back();
}
to see if a page is loaded in a specific frame, use
if (self != frames[<desired_index>]) {
// appropriate action.
// use the querystring or hash properties
// or the location.href to provide
// information to a dynamically written
// frame
var betterloc = '/jsframe.html?aframename=' + self.location.href;
// sick people with multiple frames
// may need to provide a complete
// analysis of their madness...
try { // if top is a foreign host, location is tainted
top.locaiton.href = betterloc;
} catch {
open(betterloc);
history.back();
}
}
The file jsframe.html could then parse the querystring and write an appropriate frameset.
I use this technique to show/hide contents frame, it's a common technique.
-anders
Fox Roberts wrote:
The JavaScript sollution:
Put the following between <head> and </head> into your frameset page:
<script language="JavaScript">
<!--
var frameset_loaded = "thankfox";
if (self != top)
{
top.location.href=self.location.href;
}
//-->
</script>
Then put the following between <head> and </head> into all your subpages:
<script language="JavaScript">
<!--
if (top.frameset_loaded != "thankfox")
top.location.href = "http://www.yourdomain.com/yourpages";
//-->
</script>
And Anders, don't forget this: Frames Rule!
Fox