I think this is possible with Javascript, but I'm not familiar enough with the language to be sure. Basically, whenever the user closes the browser window/tab or navigates away from the page I'd like some text and maybe in image to fade in (using jQuery) and then the window/tab would be closed, or the user would be taken to their desired page. I feel like this should be possible, but I fear it isn't because it would be so easy to exploit.
window.onbeforeunload = function() { alert("MESSAGE"); } Code (markup): But I don't think that there is a way to display something on the page and delay the exit any other way... You could display a popup on exit, but most browsers would block it anyway, and it would just annoy anyone who did see it.