|
Deframing a Page Freeing a Page That's Stuck Inside Someone Else's Frames
In frame circles, proper etiquette dictates that links to external sites should either take over the entire screen (TARGET="_top") or should be displayed in a separate browser window (TARGET="_blank"). Unfortunately, many framesters don't follow this etiquette and, instead, greedily display every link within their frames. Besides cursing their ancestry, what can you do to make sure that your page doesn't get jailed within someone else's frames? Toss a little JavaScript at them, of course. Assuming your page is named "index.asp", insert the following JavaScript into your page between the </HEAD> and <BODY> tags:
<script language="JavaScript" type="text/javascript">
<!--
if (top != self) {
top.location = self.location
}
//-->
</script>
The if() test compares top with self. If they're not the same, it means your page is inside another site's frameset. You correct that by setting top.location equal to the address of your page as given by self.location. This technique assumes your site doesn't use frames. If you do use frames, then one of two things will happen:
|