t h e i n t e r n a t i o n a l
I Hate Frames Club

I Hate Frames
Home | | Sites | | Message | | Why? | | Obnoxious | | Images | | Join | | Voice | | Members | | Supporters | | Java







Miembro Del Club las Odio Frames





Frame Breaking JavaScript Code
If you have your own website and don't want it framed, there are a few different ways to prevent it with the miracle product of the 90's, JavaScript.



This basic code puts a link on your site that says "Break out of a frame." You'll need to replace "yoursite.com" with your own webpage URL. This is probably the safest way to break frames because it works in many different browsers.
<a href="http://yoursite.com/" target="_parent">Break out of a frame</a>



This code was sent in by Christ Risen. This code works almost the same as the one above. More information can be found Here.
<META HTTP-EQUIV="Window-target" CONTENT="_top">Break out of a frame</a>




This JavaScript, sent in by Melissa Gruenhagen and Gypsy-J, automatically breaks your site out of a frame. The <HTML> <HEAD> and <BODY> tags were left in to indicate where on your page the code should be placed. This is the code we use on the index page at the club.
<HTML>
<HEAD>
<TITLE>Your Page Title</TITLE>

<SCRIPT LANGUAGE="JavaScript">

<!-- Breaks users out of frames. Put this under the body tag -->
<!-- Hide script from older browsers
setTimeout ("changePage()", 3000);

function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="http://yourpage.com";
}

// end hiding contents -->

</script>

</HEAD>
<BODY>





This JavaScript, sent in by Andy Carmichael, works much like the one mentioned above, it's a common frame-busting JavaScript to break your site out of frames. Once again, the <HTML> <HEAD> and <BODY> tags were left in to indicate where on your page the code should be placed.
<HTML>
<HEAD>
<TITLE>Your Page Title</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--
// frame-busting script
setTimeout ("changePage()", 0);

function changePage()
{
if (self.parent.frames.length != 0)
self.parent.location=document.location;
}
//-->
</SCRIPT>

</HEAD>
<BODY>





A very elaborate JavaScript sent in by JazMan. I haven't tested this one kiddies so you're on your own. Once again, the <HTML> <HEAD> and <BODY> tags were left in to indicate where on your page the code should be placed.
<HTML>
<HEAD>
<TITLE>Your Page Title</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--
if (self != top) { history.back(); top.location.href =
'http://www.YOUR_ADDRESS_HERE.com/index.html'; }

var loaded=0;
var browser='no';
if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 3) browser='yes';

function stat(txt) {
window.status = txt;
setTimeout('window.status=""',10000);
}
// -->
</SCRIPT>

</HEAD>
<BODY>





This JavaScript, sent in by trL, works much like the two mentioned above, it also sends up a warning box after the frames are broken. Once again, the <HTML> <HEAD> and <BODY> tags were left in to indicate where on your page the code should be placed.
<HTML>
<HEAD>
<TITLE>Your Page Title</TITLE>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
if (top.frames.length > 1) {
top.location="http://yourpage.com";
alert("Got rid of them damn frames for ya!");
}
// -->
</script>

</HEAD>
<BODY>








t h e i n t e r n a t i o n a l
I Hate Frames Club

wwwVOice Humor Zine Thing
Home | | Sites | | Message | | Why? | | Obnoxious | | Images | | Join | | Voice | | Members | | Supporters | | Java



Comments?
© Copyright 1996, 1997, 1998, 2002 Bud Uglly Design