1

I need to find browser close button click event in my web application. I need to show some alert message on that event. I tried to do it using window.onbeforeunload event, but it gets called on every page navigation or page refresh I need to execute that function only on close button click event

Kanwar Singh
  • 908
  • 12
  • 21

1 Answers1

2
$(function () {
  $("a").click(function {
    window.onbeforeunload = null;
  });
});

see here

Community
  • 1
  • 1
Amit
  • 2,495
  • 14
  • 22