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 messageDisplayExit = function() {
return exitmessage;
};
window.onbeforeunload = DisplayExit;
Solution 3:
There is a JavaScript onunload event that you might be able to utilize.
Post a Comment for "How To Popup When A Visitor Exits From A Website"