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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Detecting Browser Window Closings

    I've seen sights that do popup windows whenever you close their pages and I was wondering where I can get something like that or how ever they do it.

    Thanks

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To my knowledge you can only do this in IE. All you have to do it put:

    window.onbeforeunload=function(){return ''}

    The return '' means that no text of your own will appear in the pop-up box. You can put text between the quotes if you want some of your own text to appear. Basically this handler allows people and stay on the page incase they made a mistake and didn't mean to exit the page.
    - Maximus

  • #3
    New Coder
    Join Date
    Jul 2002
    Location
    Alcoy (Spain)
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think that what you mean is how you can load other urls when you close a window.

    It is quite easy if you use the onUnload event, this event make happen when you unload or close the window. In this moment you can open a new window, show a message,...



    <body onUnload="alert("This can be a solution");">

    I think that is what you want.

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    SWEEEEEET, they're both what I what I was looking for.


    Thanks tons,
    Larry


  •  

    Posting Permissions

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