title: Checking online status from an iPhone web app
body: <p>Is there a way to check to see if an iPhone is online from a web app. That is, in mobile Safari, can I check the online status of the device to see if I should try an AJAX call or not.</p>
  
  <p>In Firefox/regular WebKit, this would be:</p>
  
  <pre><code>if(navigator.onLine) 
  {
      onlineCode() 
  }
  </code></pre>