+ 1
Which function is called at the time of browser closing .
at the time the user close the browser i want a function gets called and delete its data from database .
2 ответов
+ 5
window.onbeforeunload = function(e) {
e.returnValue = 'Please dont leave me.';
return e.returnValue;
};
0
sorry calvin but your code only works when i close the tab but it is not working when i close the browser.