Forum Moderators: open
<SCRIPT Language="JavaScript">
<!--
var real_location = "http://www.yourshere.com/";
function nogojoe () {
if (top.location) {
if (self != top) top.location = self.location;
}
else {
if (parent.location) {
if (parent.location != real_location) parent.location = real_location;
}
}
}
//-->
</SCRIPT>
<BODY onLoad="nogojoe()">
if (parent != self) top.location.replace("yourpage.html");
I prefer the replace() method because the browser history remains intuitive. However, replace() is JavaScript 1.1. For greater compatibility, this code:
if (parent != self) top.location="yourpage.html";
is entirely JavaScript 1.0. But it does add an extra entry to the browser history.
Once you test to see if there is a parent for your page, the exact window configuration doesn't really matter, as I see it. So this code just says "Do I have a parent? If so, load me at the top level."