<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>

That same code should work in the WebKit nightly build as of May 16th 2008. I guess that means you need to hope the 2.1 update included a new build of safari.
https://bugs.webkit.org/show_bug.cgi?id=19105