Howto unframe web pages using JavaScript

From LinuxReviews
Jump to navigationJump to search

These are some JavaScript ways of making your site gets the full browser window when people lcick to your site from one of those sites who open the sites they link to in framed windows (like google images).

The JavaScript[edit]

<script type="text/javascript"> 
if (top.location != location) { 
top.location = location; 
} 
</script>

A less clean way of doing it:

<script type="text/javascript"><!--
var _tl=top.location,_sl=self.location;if(_tl!=_sl)window.top.location=_sl;
//-->
</script>