title: AJAX call on onbeforeunload to save data
body: <p>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;</p>
  
  <pre><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
     }
  </code></pre>
  
  <p>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..</p>
  
  <p>Also just to add the AJAX call is actually a DWR (Direct Web Remoting) call.</p>
  
  <p>Please suggest how I can fix this issue.</p>