« Home



JavaScript Exit Interrupt Dialog Example

Wow, this is a mixed bag. While this basic functionality is super helpful -- for example, the GMAIL UI uses it to let to know that you have unsaved changes and confirm that you want to abandon them before you let the browser unload the page, virtually every marketer that I've ever met wants to bend it too their will to annoy users who are rejecting their initial "deal", with something that's "even better" before locking in their answer which involves giving the poor marketer and the company or product they represent, the finger. Hmmm, sorry about that, I didn't realize that was in their, guess I'm still a little anti-status-quo when it comes to business (my inner evangelist wants to believe that if you give a customer what they want, for the price they want to pay, you both win, and they'll say nice things about you to their mother or PTA group).

As this type of widget has become more popularly requested of late, I thought I'd share. Your feedback is appreciated.

Click the button to Activate or Inactivate the exit mechanism. Once it's active, try reloading the page (or closing the browser, or surfing away from the page) and before the page is unloaded, you should see a modal dialog box appear with the option to proceed (by clicking "OK"), or stop (by clicking "CANCEL"). View the source to see how the exit pop is done.





« Home