On this page ...
Escaping from frames ...
You probably have seen this before,
lazy people and/or "control freaks" that keep external
pages where they link to, hooked into their own frames.
JAVAScript can help your page to
automatically escape those frames!
So, how can I leave frames ?
|
 |
Using Links
Regular links can escape from frames by
using a target value "_top", for example:
<A HREF="http://www.somewhere.com/"
target="_top">Escape those frames!</A>
Automatically
Use this little script to do so:
<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout ("changePage()", 1000);
function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="http://www.somewhere.com";
}
// -->
</SCRIPT>
This script works only if you have no frames
on original your webpage! It escapes to http://www.somewhere.com.
Note: If your browser
generates a nice JavaScript error: your browser does not support this
feature!
|