HTML forms work offline

I need to be able to run HTML forms offline. I mean, they should work without a direct connection to the web server.

In an application that I wrote more than 5 years ago, I did this by running my own protocol handler - when the user initiated the submit form, the received HTTP request was recorded locally. At a later time, when the connection to the server becomes available, the synchronization program goes through the collected requests and sends them to the server, collects the responses and saves them again locally for later use.

That was then. Now another client approached us with a very similar request. What technology do you guys think I'm using today?

HTML5 support is very limited so far. Google gears? Or do I need to go back and continue using the protocol handler and user synchronizer?

+5
source share
5 answers

I would say for HTML5. Not all browsers support it; but everything will be. Meanwhile, I think it’s better to say “to disable offline features, try such and such a browser” rather than “please download this huge plugin with many scary warnings”.

Also simple demography: HTML5 is what, 5% of all browsers? 10%? there are still a lot more than 0% of users with Gears already installed.

, Google , Gears; Flash. , HTML5 .

+4

Google Gears - . Google , . cookie, , cookie .

+2

, Google Gears . gears http://code.google.com/p/gears/issues/list?can=2&q=&sort=version&colspec=Version%20Milestone%20Owner%20ID%20Summary%20Component Gears, 3 , 0.6. , (http://en.wikipedia.org/wiki/Google_Gears), , Google , . :

" 2009 - , Google HTML 5, Gears . Google , Google, , Gears, , ."

, Gears . HTML 5.

+2

Dojo.Storage/Dojo Offline, flash, , . , 5 . , HTML 5, cookie .

, .

+1

Google Gears : http://gearsblog.blogspot.com/2011/03/stopping-gears.html

- , , HTML5 applicationCache localStorage.

, applicationCache - . , , , applicationCache localStorage ( ) :

http://www.alistapart.com/articles/application-cache-is-a-douchebag/

, localStorage, , , :

http://miniapps.co.uk/blog/post/using-html5-localstorage-as-a-fallback-for-offline-form-submission

Also, beware of window.navigator.onLine to detect an offline state - it is not implemented sequentially in browsers, and you are probably better off if the user explicitly tells you whether they are offline or not.

- Chad

+1
source

All Articles