0

i have searched the same and i got

$(window).on('beforeunload', function() {
    return 'Are you sure you want to leave?';
});

$(window).on('unload', function() {
     logout();
});

But above functions work on every request .i just want to check only browser close event usning javascript or jQuery. Thank you

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
ANucool Mittal
  • 205
  • 4
  • 13

0 Answers0