Wednesday, July 17, 2013

What is the event called for closing window in Javascript?

Onbeforeunload
Reference: https://developer.mozilla.org/en-US/docs/Web/API/window.onbeforeunload

window.onbeforeunload = function(e) {
  return 'Dialog text here.';
};

No comments:

Post a Comment