View Full Version : Break out of Frames code?


Meghann_78
07-28-2006, 03:58 AM
I'm sure I seen it on this website but now I cant find it :confused:

Could someone pretty please tell me what it is? :)

thezeppzone
07-28-2006, 04:06 AM
For a link:


<a href="http://www.site.com/link.html" target="_top">Link</a>



That will make it so the link opens up in the entire browser and not the frame. Hope that's what you were looking for!

Meghann_78
07-28-2006, 04:20 AM
Thanks heaps!! :D

J to the izzosh
07-29-2006, 01:09 PM
If you're looking to reload your page as a full window whenever it's loaded in a frame, then it's usually a simple Javascript like the following:

if (top != self){
top.location = self.location
}

That's from one of my older pages, when I tended to focus on IE, so I'm honestly not sure how well it works across the board, but it gives you an idea of what to look for, at least.

pb&j
07-29-2006, 06:21 PM
this is the one i use. seems to work ok in different browsers.

<script type="text/javascript">
<!--
if (window != top) {
top.location.href = location.href;
}
// -->
</script>

as JttI mentioned, this prevents your page from showing inside of other peoples frames if that is the direction you were looking for.