Breakout of frames (Javascript)

by spyka (http://www.spyka.net)

Put the below code in the <head></head> part of your document. The code will break the page out of any frames it finds itself in automatically onload

Code:
<!-- Copy & Paste - <head></head> tags -->
<!-- www.spyka.net -->
<script type="text/javascript">
<!--
function breakout() {
    if (top.location != location) {
        top.location.href = document.location.href ;
    }
}
window.onload=breakout;
//-->
</script>

Code demo

Breakout of frames online demo

Help and comments

Discuss this and other scripts in our webmaster foruns

Learn more about our forums