Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Window Check

  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Window Check

    Is there a way to check if the window is open?
    I'm trying to create a script that will force the user to close the window, since window.close only asks them if they want to. What I want to do is have the window.close confirm come up, and if they hit no, it will come up again. I've tried doing this with a loop, but the confirm comes up again whether they click yes or no. I suppose this is OK, since it eventually requires them to close it with CTRL+ALT+DEL, but it could be done more nicely...

  • #2
    New Coder
    Join Date
    Nov 2003
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    while (1)
    {
    alert ("hahah");
    };

    That should piss them off enough to ctrl-alt-del.

    j/k don't do that.

    I don't think you can force close. I would recomend just pointing the browser to another site or a dummy page.

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Remember that the user may have sites in the history that they want to go back to after they are done with yours. Don't prevent them from doing so.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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