How can I prevent a page from being captured in someone else's frameset?

The technique is called frame busting.  Put the following script in the head of the page:

<script>
if (window!=top){top.location.href=location.href;}
</script>

Whenever the page loads, it checks to see if it is in a frameset (that is, not the "top" window).  If it is, it reloads itself as topmost.

Close