I'm considering developing a web app with offline capability. I'm considering formatting all client form postbacks as JSON objects, and writing these direct to HTML5 LocalStorage on a form postback. I'll then have a separate process that asynchronously polls the LocalStorage for JSON entries and submits these to the server. This server-sync process will not have any UI context. The actual user UI can then be very responsive. (I'll use cache manifest files to deal with other offline issues).
Is this a sound plan, and what would be the best technical implementation of the asynchronous JSON post process? (perhaps a timer, polling LocalStorage and checking the server connection every second?) Is there a better way to implement the server sync (if I was implementing this on a server, I'd write a service - is there an equivalent javascript mechanism?)
Thanks.