Hi All
I am using the window.onbefore unload event on a webpage as follows :
The function returns a prompt to the user correctly.
If the user clicks "OK" on the dialog, the page exits correctly. However I would like to know if the user clicks "Cancel" .
The reason behind this is that I have a animated gif which appears on the unloading of a window and if the user clicks "Cancel" which stops the unload I would like to hide the animated gif.
Does anyone know how to determine if the "Cancel" button on the onbeforeunload dialog has been selected?
Thank you in advance.
Tecknick
I am using the window.onbefore unload event on a webpage as follows :
Code:
window.onbeforeunload = confirmExit;
function confirmExit()
{
if (changesMade == 1 && needToConfirm)
{
return "You have not saved changes on this page";
}
}
If the user clicks "OK" on the dialog, the page exits correctly. However I would like to know if the user clicks "Cancel" .
The reason behind this is that I have a animated gif which appears on the unloading of a window and if the user clicks "Cancel" which stops the unload I would like to hide the animated gif.
Does anyone know how to determine if the "Cancel" button on the onbeforeunload dialog has been selected?
Thank you in advance.
Tecknick
Comment