I would like to print a message on the close of the browser tab. Something like this:
Please don't close this tab.....an important file is running on the same tab............closing this may lose the data
How do I do it?
I would like to print a message on the close of the browser tab. Something like this:
Please don't close this tab.....an important file is running on the same tab............closing this may lose the data
How do I do it?
You can use window.onbeforeunload
window.onbeforeunload = function(e){
return "Do you want to close?";
}