I have a javascript function to fire when page/browser close like this:
window.onbeforeunload = function (e) {
var y = window.event.clientY;// e.pageY || e.clientY;
if (y < 0) {
alert('Window closed');
}
else {
alert('Window refreshed');
}
The function work fine IE but not in other browsers. I want to fire this function only at browser/tab close of a webpage. Not in the page refresh/reload.
Please help.