• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Javascript Question

DeadlyDrew

Junior Member
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...
 
this should do it:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--

if (window != top) top.location.href = location.href;

// -->
</SCRIPT>
 
Back
Top