window.onbeforeunload = function (event) {
//action
};
I have tried this link but it also get fired on page refresh. How to capture the browser window close event?
window.onbeforeunload = function (event) {
//action
};
I have tried this link but it also get fired on page refresh. How to capture the browser window close event?
this is the handle on manual refresh..
$('body').on('keydown', function(e) {
if (e.keyCode == 116){
//code here. to prevent calling window.onbeforeunload
}
});