A Javascript, to break out of frames

When a page that contains the following Javascript is linked to from within a frame it will automaticaly direct the browser to load it in the parent window.

<SCRIPT>
function moveup()	{
	if(self != parent)
		parent.location.href="pagename.html"
}
</SCRIPT>

Include it within the Header of your HTML document. To be most effective it should be placed right at the start of the <HEAD> element. Make sure to replace pagename.html with the actual name of the file. Next modify the <BODY> element to read as follows

<BODY onLoad="moveup()">
Use your text editor to cut and paste the code in your pages. If you run into trouble send me an email.

Click here to load a copy of the previous page that includes the above script in the header. If your browser is Javascript enabled it will load without frames.
Please click here to return to the previous page within these frames

If you find this script useful please provide a link to this site. The URL is
http://www.webquarry.com/~raditha/

Web Design  :  Frame  :  Jail Break!  :  Don't Frame  :  Wizard


Intro  :  FTP  :  HTML  :  Frames  :  Domain Names
Advanced Topics  :  Banner Exchange  :  Meta Tags  :  Links
Home  :  Search  :  Sri Lanka  :  Shareware  :  Mail & News
Web Design  :  What's new  :  What's Cool
Site Map  :  Links  :  Feedback

raditha@webquarry.com, Oct 21, 2003.