I have a page where a user performs some activity (Add/Update/Delete) and on unload of the page (actually refresh/navigating away) I make an AJAX call to save the data. Below is the code;
window.onbeforeunload = function () {
someAjaxObj.saveFavorites(json,{async:false}); // use async:false else callback is returned to an unloaded page creating a dwr javascript error
}
Now for some reasons, the data does not get saved/reflected after refresh on iPad Safari. I tried changing "onbeforeunload" to "pagehide" for iPad, but still data does not reflect after refresh..
Also just to add the AJAX call is actually a DWR (Direct Web Remoting) call.
Please suggest how I can fix this issue.