Results 1 to 2 of 2

Thread: Burst out of iFrame (Javascript : Onload)

  1. #1
    Join Date
    Dec 2006
    Location
    Near Derby, UK
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Burst out of iFrame (Javascript : Onload)

    I have this script to burst out of an iFrame:

    Code:
    ...
    <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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Way too complicated. This is all you need:

    Code:
    <script type="text/javascript">
    if(top.location!=location)
    top.location=location;
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •