Run the following code when the js page loads
window.onbeforeunload = function(){
return " Unsaved content may be lost ";
};
This code does not show the value of return in firefox or Internet explorer and displays this text in the Google browser.
Failure to control
Trigger js to run as follows:
window.onbeforeunload = function(){};