PDA

View Full Version : Burst out of iFrame (Javascript : Onload)



spam_banjo
07-12-2007, 05:53 PM
I have this script to burst out of an iFrame:


...
<head>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" >
<!--

function FrameBuster(){

window.focus();

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

-->
</script>
</head>
<body onload="FrameBuster();">
...

It does not work in Firefox.

Can't figure out what's wrong. The error console shows nothing.

Can anyone help, or can anyone suggest a solution which works in Firefox, as I am making an on-line app, and we are dictating the browser used as Firefox.

jscheuer1
07-12-2007, 06:30 PM
Way too complicated. This is all you need:


<script type="text/javascript">
if(top.location!=location)
top.location=location;
</script>