+ 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 .

28th Aug 2018, 6:31 AM
Nilesh kumar
Nilesh kumar - avatar
2 Réponses
+ 5
window.onbeforeunload = function(e) { e.returnValue = 'Please dont leave me.'; return e.returnValue; };
28th Aug 2018, 7:34 AM
Calviղ
Calviղ - avatar
0
sorry calvin but your code only works when i close the tab but it is not working when i close the browser.
28th Aug 2018, 10:35 AM
Nilesh kumar
Nilesh kumar - avatar