HTML Code:
<body OnLoad="leaving=true" onunload="return exitpop();return false">
It means that, when you unload the page (leave it), it runs exitpop(), which is a javascript function. I guess it would look something like this:
Code:
function exitpop() {
alert('I am a pop up!');
return false;
}
However, putting something like this on your site, IMO, makes it less professional and a hindrance. I hate to be held back by a website when I want to leave.