I want to display a popup with personal message when user close the browser I found many similar scripts but they work in firefox and not in chrome, Is there any solution to this ?
window.onbeforeunload = function (event) {
var message = 'Important: Please click on \'Save\' button to leave this page.';
if (typeof event == 'undefined') {
event = window.event;
}
if (event) {
event.returnValue = message;
}
return message;
};
Also I am not having the message in the code but I have annother message like this : "Cette page demande de confirmer sa fermeture ; des données saisies pourraient ne pas être enregistrées"