Skip to content Skip to sidebar Skip to footer

How To Popup When A Visitor Exits From A Website

My company creates web surveys and once in a while I get asked if we can do an exit survey on a website. So when a visitor is about to leave the site a 'popup' appears asking if th

Solution 1:

Surely they 'exit' the site by closing the window/tab? You're asking for a way to prevent them closing the tab? Or popup a window triggered by the close action? That sounds like it would be prevented by the browser for good reason, and if you found a workaround it would be likely to be fixed in future versions.


Solution 2:

var exitmessage = 'Please dont go!'; //custome message
DisplayExit = function() {
    return exitmessage;
};
window.onbeforeunload = DisplayExit;

Solution 3:

There is a JavaScript onunload event that you might be able to utilize.


Solution 4:

Unbelievable that even in 2009 people want to create crap sites.

AdBlock Plus in my FF stops all popups. If I use another browser I usually close the window before it get to load its content.


Post a Comment for "How To Popup When A Visitor Exits From A Website"