PDA

Click to See Complete Forum and Search --> : Frames Page Questions


DeadlyDrew
Mar 9th, 2001, 12:13 AM
This is a frames page question.
The following code tells the browser that if this individual frame page is not loaded within a frame then it is to be redirected to said website. What this prevents is your framed pages getting loaded to _top.


<script>
if (parent.location.href == self.location.href){
// change the url below to the url of the
// frameset page...
window.location.href = 'http://www.boredtechs.com'
}
</script>


My question is. I need code that works the other way around. If my page gets loaded in to a frame I want it to automatically jump to _top. Meaning burst out of the frame and load full browser. This is to prevent a page being loaded in to a frame.
Thanks in advance...

DeadlyDrew
Mar 11th, 2001, 05:57 AM
Cool, thanks...

Mar 11th, 2001, 06:10 AM
so you were the one from BoredTechs.. pretty cool site mate.. I'm Volcano

DeadlyDrew
Mar 11th, 2001, 08:53 PM
Yep, that was me...
Thanks for stopping by. I hope we can make a great site that will be really helpful for people as well as a place they enjoy coming back to to just hang out.
What do you specialize in with computers? Or are you just an average user that is into many things like me?
Talk to you later...

Mar 12th, 2001, 12:13 AM
i'm just an average user like you... just programming for fun when bored with all those school work.. anyway nice site.. it will be great when a lot of others will join in..

we'll make an effort :)

Lord Orwell
Mar 14th, 2001, 10:30 PM
this is a more generic use that doesn't require changing for any page you put it in(no constants), thus you can use it in an included file.

<SCRIPT LANGUAGE="JavaScript">
function checkParent() {
if (parent != self)
top.location.href = self.location.href
}
</SCRIPT>