rgarimella
asked on
onUnload and onbeforeUnload events not firing
Hi folks,
Any ideas why the onUnLoadFunction(); is NOT called in Mobile Safari in iOS7. This functions is called in all browsers EXCEPT Mobile Safari on iOS7.
Any Ideas?
Any ideas why the onUnLoadFunction(); is NOT called in Mobile Safari in iOS7. This functions is called in all browsers EXCEPT Mobile Safari on iOS7.
Any Ideas?
window.onunload = window.onbeforeunload = (function(){
var saveInLMS=false;
return function(){
if (saveInLMS) return;
saveInLMS=true;
onUnLoadFunction();
}
}());
ASKER
How about onbeforeUnload ?
How do i call a function when Mobile Safari window closes ?
How do i call a function when Mobile Safari window closes ?
The only thing I have seen show up in research for both unload and beforeunload is that they do not work for safari on mobile.
Generally when a user closes a window, they want to close it; so most developers consider it bad practice to interfere with the exit. What is it that you think is so critical that that you have to grab your users by the throat and prevent them from a clean exit?
Cd&
Generally when a user closes a window, they want to close it; so most developers consider it bad practice to interfere with the exit. What is it that you think is so critical that that you have to grab your users by the throat and prevent them from a clean exit?
Cd&
ASKER
I have a SCORM course that works on a Learning Management System. So the code that I have sends information to the LMS when a users exits a course/closes the tab/window I need to send information to the LMS, on which page the user had exited and send some cleanup code.
I have the code working in ALL the browsers including iOS6 mobile safari. But for some reason the same code DOES NOT work in iOS7 mobile safari.
Thanks
I have the code working in ALL the browsers including iOS6 mobile safari. But for some reason the same code DOES NOT work in iOS7 mobile safari.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Cd&