Hi Guys,
I have attached the beforeunload event and its handler to the window as :
// this is FireFox only
window.addEvent Listener("befor eunload",before unloadHandler,f alse);
function beforeunloadHan dler(event){
event.returnVal ue="my message !";
}
now the string "my message !" will be display on a confirm dialog box ,
my question could I hide that dialog box, or at least prevent it from being shown .
of course my goal is to prevent the default behavior of the beforeunload event .
I have tried event.preventDe fault(). I get the dialog box again .
any comments ?
thanks .
I have attached the beforeunload event and its handler to the window as :
// this is FireFox only
window.addEvent Listener("befor eunload",before unloadHandler,f alse);
function beforeunloadHan dler(event){
event.returnVal ue="my message !";
}
now the string "my message !" will be display on a confirm dialog box ,
my question could I hide that dialog box, or at least prevent it from being shown .
of course my goal is to prevent the default behavior of the beforeunload event .
I have tried event.preventDe fault(). I get the dialog box again .
any comments ?
thanks .
Comment