apparition of PopUp on closing browser ?

Discussion in 'JavaScript' started by ParisByPod, Jan 7, 2008.

  1. #1
    Hello,

    I have to make a popup appear when the website is closed under the 3 following conditions :

    1. browser is closed (ALT f4 or clicking he red cross top-right corner)
    2. a new URL is typed under the URL broser
    3. a click is made pointing to an external link

    Using traditional popups, I can manage the 3 cases.

    Using "layered popups", I have only been able to manage case #3.
    Which means I can't have the layered popup appear under case 1 and 2.

    Is there a way to have a layered popup appear in case 1 and 2 ?

    Last question : I find it quite "spammy" to have a popup appearing on exit, when leaving a website, what's your thought on that point, ?

    Any idea appreciated :D
     
    ParisByPod, Jan 7, 2008 IP
  2. mvl

    mvl Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I hate onUnload popups to be honest. You could use the onUnload event on the body element for this but most modern browser probably block popups by default (and for a good reason: people don't like them)
     
    mvl, Jan 7, 2008 IP