Break your web page out of someone else's frameset

It is very easy for another site to frame your web page in their own site, denying site visitors from viewing your own brand and navigation.
Likewise, it is very easy for you to defeat this rude practice.

The following javascript can be used to prevent a page from being framed in another frameset. The page will redirect to itself as a _parent location.

<html>
<head>
<script type="text/javascript">
	function check_for_frames() {
		if (top.frames.length > 0) {
			top.location="http://www.yourdomain.com/";
		}
	}
</script>
</head>	
<body onload="check_for_frames();">

<p>This page is being forced to be viewed outside of a frameset.</p>

</body>
</html>
Undefined
Topic: