title: window.onbeforeunload not working on the iPad?
body: <p>Does anyone know if the <code>onbeforeunload</code> event is supported on the iPad and/or if there's a different way to use it?</p>
  
  <p>I've tried pretty much everything, and it seems like the <code>onbeforeunload</code> event is never triggered on the iPad (Safari browser).</p>
  
  <p>Specifically, this is what I've tried:</p>
  
  <ul>
  <li><code>window.onbeforeunload = function(event) { event.returnValue = 'test'; }</code></li>
  <li><code>window.onbeforeunload = function(event) { return 'test'; }</code></li>
  <li>(both of the above together) </li>
  <li><code>window.onbeforeunload = function(event) { alert('test')'; }</code></li>
  <li>(all of the above functions but inside <code>&lt;body onbeforeunload="..."&gt;</code> </li>
  </ul>
  
  <p>All of these work on FF and Safari on the PC, but not on the iPad.</p>
  
  <p>Also, I've done the following just after loading the page:</p>
  
  <pre><code>alert('onbeforeunload' in window);
  alert(typeof window.onbeforeunload);
  alert(window.onbeforeunload);
  </code></pre>
  
  <p>Respectively, the results are:</p>
  
  <ul>
  <li><code>true</code></li>
  <li><code>object</code></li>
  <li><code>null</code></li>
  </ul>
  
  <p>So, the browser does have the property, but for some reason it doesn't get fired.</p>
  
  <p>The ways I try to navigate away from the page are by clicking the back and forward buttons, by doing a google search in the top bar, by changing location in the address bar, and by clicking on a bookmark.</p>
  
  <p>Does anyone have any idea about what's going on? I'd greatly appreciate any input.</p>
  
  <p>Thanks </p>