var args = location.search.substr(1).split("?");
if (top.location != self.location && args != "fm") top.location = self.location;
Let is suppose that your page is called index.html and that therefore any links to your page will be coded like this.
<a href="index.html">link to page</a>
We do however now have a second way that we can link to the page where we tell the page not to break out of any frames that it may happen to be in. To do this we code the link like this:
<a href="index.html?fm">link to page</a>
We can of course also make use of this to code a reference to the page within a frameset definition itself using the following code:
<frame name="main" id="main" src="index.html?fm" />
So this version of the page gives you complete control over when your pages will appear in frames because unless you specifically add the ?fm to the end of the link the page will automatically break out of any frameset and since you will only specify the ?fm where the page is to be displayed in frames the index.html?fm address will not appear in the address bar making it unlikely that others will think to include it when linking to your page.
This article written by Stephen Chapman, Felgall Pty Ltd.