Tricky Tricks ›› Programming Tricks ›› Javascript Tricks ›› Remove A Page Automatically From A Frame Controlled By Another Site

Remove A Page Automatically From A Frame Controlled By Another Site

Javascript Tricks

Is there a way I can have my page automatically remove itself from a frame controlled by another site?

This little chunk of javascript will automatically remove your page from another site's frame. It is still a good idea to use the text link method to support older browsers.

Ssource Code

 <SCRIPT LANGUAGE="JavaScript">
 <!--
 setTimeout ("changePage()", 3000);
 function changePage() {
 if (self.parent.frames.length != 0)
 self.parent.location="http://www.bignosebird.com";
 }
 // -->
 </SCRIPT>
 

Partners