Javascript Exit Popup

My team has been looking for some good exit popup code for a client and found it hard to find code that would pop an exit popup when a user was leaving the page without also calling the popup when users clicked internal links. With that said I searched google for:

  1. code for exit popup
  2. code for smart exit popup
  3. code for smart exit popup javascript
Before finally hitting the right answer with:

The first result from Gath Adams hits the nail right on the head: Code the perfect Exit Popup

I did notice a syntax error on line 36

alert(’Here is your popup!);

is missing the closing quote – so it should be:

alert(’Here is your popup!’);

Otherwise, his code works great. Thanks Gath (pronounced Garth)!

7 Responses to “Javascript Exit Popup”

  1. Gath Says:

    Glad you found it useful.

    Thanks for the info on the syntax error. I had fixed it up a while ago, but I had to restore posts from a backup & now the bug is back!

    Cheers,
    Gath

  2. Shenandoah bed and breakfast Says:

    The only trouble is that is not a real popup. It’s just a dialogue box. We want real popup that can’t be blocked.

    Thanks,

  3. mIRC Says:

    Good…..

  4. hisse senetleri Says:

    thanks. i use this code. i follow you…

  5. clare Says:

    I’m actually anti pop up !

  6. Namrata Says:

    thnaks for sharing

  7. kanishk Says:

    Thanks for sharing Java exit popup code.
    I am also java developer and it would be definitely help me out.
    Its come only trouble that is not real popup.
    Thank
    Infant Baby Bedding

Leave a Reply

This entry was posted on Saturday, August 15th, 2009 at 6:14 pm and is filed under Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.