Thursday, 6 July 2017

How to browser close and tab close event in JavaScript

Following javascript code you could use to detect browser close and tab close event.

window.onbeforeunload = function () {
    alert("Do you really want to close?");
};

No comments:

Post a Comment