I'm trying to detect if a user is leaving my websites. Like a window/tab close event of the webbrowser or by following a link to a other domain.
In some searches I found some solutions, but they alert ever when a link is clicked, also on my pages. As example I tried out this:
window.onbeforeunload = function(event) {
event = event || window.event;
var confirmClose = 'Are you sure?';
// For IE and Firefox prior to version 4
if (event) {
event.returnValue = confirmClose;
}
// For Safari
return confirmClose;
}
So what do I have to modify so that the alert is deactivated when I'm browsing through my domain?
Thanks Oliver