I've started using HTML5 application cache to provide the possibility for users to use web resources even when they're offline.
The idea is that the user downloads the page in the morning, and enters data into the form through the whole day. If he happens to be online post the data to the server, if not, it should be cached in localStorage.
I have added the filename to the cache.manifest with its js, css resources.
The problem i see that after the caching of the page, only the local copy is displayed, even if the client has connection to the server.
I would like to be able to load the page from the server, if we're online, and load it from the appcache if we're offline.
(Also, how should i decide properly if I'm online or not... i've tried window.navigator.onLine, but i think it's better to actually send an XHR to the server to determine if the connection is there).
Any suggestions?