Place the following code in the header
<script language="JavaScript" type="text/javascript">
<!--
function break_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 break_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="break_out_frames()">
That's it.
For
a list of Books on Javascript for Beginners and Advance Coders click here!
Related Articles for Javascripts Window Effects:
 |
Breaking out of frames
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. |
 |
Delete Warning
Javascript that alert users when clicking on sensitive links (like delete or update links). You can customize the message with option to continue or cancel. Works great with PHP, ASP, and Perl administration sites. |
 |
Source Include
Learn how to save time and money by using the javascript src() function to including local or remote document like headers, footers, css, images, and flash files. |
 |
Telephon Check Box
Javascript code that automatically fills in the telephone number in all places needed after just once entering it and selecting a check box. |
 |
List of Top Web Hosting sites with
UNLIMITED DISK SPACE |
NewSourceMedia is providing links to these listings as
a courtesy, and makes no representations regarding the content or
any information related thereto. Any questions, complaints or claims
regarding the downloaded content or details must be directed to the appropriate
publisher. We do not encourage or condone the use of any
software in violation of applicable laws.
Comments
mhmm
08.29.2006