SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot themissingelf's Avatar
    Join Date
    Nov 2001
    Location
    UK
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I stop IE5 checking?

    Is it possible to change the following code so that IE5 does not display an alert box asking the visitor to confirm that it is OK to close the window?
    PHP Code:
    <html>
    <
    head>
    <
    title>Closing Window Test</title>
    <
    script LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
    function 
    vanish() {
        
    setTimeout("window.close()"5000);
        }
    </script>
    </head>
    <body onLoad="Javascript:vanish(this)">
    <p>Testing the disappearing window</p>
    </body>
    </html> 
    Cheers

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Quick reply -- no. Rationale: Would you want someone else to close this site's main window automatically and then possibly open a site you don't like?

    Why do you want to close the window?

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is possible. I can't remember how right now though...

    Lemme try a couple things.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  4. #4
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yup, now I remember:

    Code:
    window.opener = top;
    window.close();
    works across a lot of browsers too. (everything except IE5/Mac I think)
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  5. #5
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    Vinny is right closing the main window will always display an alertbox in IE. its security related, but not in a popup window.
    Who's to doom when the judge himself is dragged before the bar


    Home | Web | Facebook

  6. #6
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you read my post? That will allow you to close any window.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  7. #7
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    Sorry Jeff, the one you did apply works great. sorry, dident read your post Jeff [img]images/smilies/frown.gif[/img]
    Who's to doom when the judge himself is dragged before the bar


    Home | Web | Facebook

  8. #8
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neat trick, Jeff! I had not seen that one.

  9. #9
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update: in order to get it to work correctly all the time in Mozilla, you need to call it like this:
    Code:
    window.opener = self;
    window.close();
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


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
  •