|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Catch the event on closing window using mozilla browser
Hi
I tried the following code to catch the event on closing window.I am taking the unloadevent. But its not working in mozilla and working in IE browser. function onBeforeUnloadAction() { var flag=window.confirm("You are closing the window. do you want to continue. Click 'Ok' to close or click 'Cancel' to stay back"); if(flag) { alert("bye"); } else { // Stop the closing browser //.... } } function fun() { if((window.event.clientX<0) || (window.event.clientY<0)) { onBeforeUnloadAction(); } Please give the solution to this one. |
|
#2
|
||||
|
||||
|
on before unload
Hi srivalli, welcome to the forums,
Maybe change Code:
if((window.event.clientX<0) || (window.event.clientY<0))
{
onBeforeUnloadAction();
}
Code:
window.onunload = onBeforeUnloadAction(); |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Catch the event on closing window using mozilla browser |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|