1
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?

Community
  • 1
  • 1

1 Answers1

0

this is the handle on manual refresh..

 $('body').on('keydown', function(e) {
     if (e.keyCode == 116){
        //code here. to prevent calling window.onbeforeunload
     }
 });
rjps12
  • 587
  • 6
  • 15