design. business. life.

Information

This article was written on 15 Aug 2009, and is filled under Web Development.

Current post is tagged

,

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:
  1. javascript exit popup

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 Comments

  1. Gath
    August 16, 2009

    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. clare
    October 12, 2009

    I’m actually anti pop up !

  3. Kevin
    April 26, 2010

    Can we open a popup in subdomain ?

  4. artu
    July 8, 2010

    * THIS CODE DOESNT WORK ON SAFARI 5/PC *
    can someone please confirm this?

  5. April
    March 14, 2011

    I just want to triple confirm–there really is no way to open an exit pop without the javascript dialogue, right?

  6. Angela
    August 24, 2011

    One problem I find using the code in asp.net – it will pop up if a user clicks the submit button! Any way around this?

  7. Jeannine
    January 24, 2012

    Hello there.

    I recon this exit pop up as a marvellous solution for getting important informations back from users abandoning the website. But I simply cannot make it work… :-/

    could you quote for assisting making it work cross browser?

    I need it to work with a joomla site, using several templates.

Leave a Reply