iui-reachability.js is an extension for the iUI framework. It is in the early development stages. It is intended to perform "reachability" testing for hybrid webapps that are wrapped in the UIWebView Cocoa Class. It may also be useful for webapps that are cached using the HTML5 webapp cache -- but hasn't been tested in that configuration yet.
iUI has recently been improved so that it provides better handling of network failures during Ajax operations. At this writing that work is still in-process and reachability-demo.html can be used to test that error handling as well.
If you have any questions (or valuable suggestions!) please post them to either the iphonewebdev and iui-developers Google group.
The best way to test error handling is to use the iPhone Simulator on your Mac with airport disabled -- unplug and replug your Ethernet cable to test error handling and recovery.