<p>What's the best way to remove a page frame automatically?</p>

<p>I've used this type of code before:</p>

<pre><code>&lt;script language="JavaScript"&gt;
setTimeout ("changePage()", 3000);
function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="http://www.example.com";
}
&lt;/script&gt;
</code></pre>

Do it this way if you want the frame-breaking step to not appear in the history
```
```
if ( self.location !== top.location )
{
    top.location.replace( self.location );
}
```
```