Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Break out of my frames

Status
Not open for further replies.

jockm

Technical User
Aug 13, 2002
41
0
0
GB
On my three-frames website at < I want to break out of the frameset from a link in the top.html frame to my alternative site for people with small monitors who cannot see all the items on my framed navbar.

I dont want my alternative site to be in my frameset, and I copied this code from Quickstart Javascript and put it in the <HEAD> section of the home page of my alternative site < figuring it would bust the frameset.

<SCRIPT LANGUAGE=JAVASCRIPT TYPE=&quot;TEXT/JAVASCRIPT&quot;>
<!--Hide script from old browsers

if (top.location !=self.location) {
top.location = self.location
}
//End hiding script from old browsers -->
</SCRIPT>

But it didnt. The Frames are still there.

What is the correct code to achieve this?

Thanks
jock
 
banner.png


For my website ( - still under construction) I use the following code to break out of frames:

Code:
<script type=&quot;text/javascript&quot;>
<!--
if (window != top)
top.location.href=location.href;


// -->
</script>

It seems to work just fine, try going to:
comframe.php loads two frames. The upper frame is a banner and the lower frame is whatever page is specified in the link= part of the url. When any of my pages are loaded within this (or any frame) they will bust out of them.

Hope this is of help to you,

keteracel



[sub]( keywords: bust frame busting break frame breaking keteracel javascript )[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top