Break Frames

Any problem with javascript can be discussed here.
Post Reply
coco
Posts: 50
Joined: Thu Dec 23, 2004 12:01 pm
Contact:

Break Frames

Post by coco »

If a visitor comes to your site and is looking through frames, this script will automatically make the page break out of frames


Copy this code into the BODY of your HTML ****

<body>

<script type="text/javascript" language="JavaScript">
<!-- Begin
if (window != top) top.location.href = location.href;
// End -->
</script>
</body>


coco
Posts: 50
Joined: Thu Dec 23, 2004 12:01 pm
Contact:

Post by coco »

[quote="rivermonkey"]My own way of doing the same thing:

<script language="Javascript">
<!--
if (top.location != self.location) {
top.location = self.location]
OH ,yeah ,is good code:)
mosherben
Posts: 9
Joined: Tue Jul 05, 2005 7:39 am

Post by mosherben »

or for any links just change the target to _top.

eg. <a href="url" target="_top">
Ben
kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Post by kaos_frack »

what if the browser does not support frames
Post Reply