How to make sure your webpage is not included in other website frames

This Tutorial Has Been Viewed 1,340 Times.

Want to make sure your web pages are not included in other website frames? Well use this break_out_frame code to stop the madness.

Place the following code in the header

<script language=”JavaScript” type=”text/javascript”>
<!–
function jump_out_frames()
{
if (top.location != location) {
top.location.href = document.location.href ;
}
}
–>
</script>

I would prefer to place the javascript function into a separate file with a name like “functions.js”. This is how the code would look inside the “functions.js” file:

function jump_out_frames()
{
if (top.location != location) {
top.location.href = document.location.href ;
}
}

To include the javascript function file into your pages, place the following code in the headers:

<script src=”functions.js” language=”JavaScript” type=”text/javascript”>
</script>

To trigger the breakout of frame javascript function, using ether of the above techniques, add the following code to the body tag:

<body onload=”jump_out_frames()”>


VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Incoming search terms:

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in JavaScripts, scripts (22 of 144 articles)


This script will show you how to read and display the values of an xml file using php. My demo.xml ...