it only works in IE 5+, and with a little bit of tweaking it might work in Mozilla/NS6...
but, it only works if the user clicks on a link in your page to leave your site.
<html>
<head>
<title>Untitled</title>
<script>
function init()
{
var s = document.getElementsByTagName("A"
for(var i = 0; i < s.length; i++)
{
s.attachEvent("onclick", function(){if(this.hostname != document.location.hostname){var c = confirm('Are you sure you want to leave my site?');if(!c){return false;}}});
}
}
</script>
</head>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.