/using-html5-localstorage-as-a-fallback-

  • Using #HTML5 #localStorage as a fallback for offline #form submission - MiniApps Blog
    http://miniapps.co.uk/blog/post/using-html5-localstorage-as-a-fallback-for-offline-form-submission

    how you might use HTML5 localStorage as a fallback for form data submission when a mobile device is offline without signal.
    The demo uses window.navigator.onLine to listen for a boolean value of true or false, determining whether the device is online or offline. When online, the app makes a regular XmlHttpRequest and sends data to a server. If the device loses signal and goes offline, the app queues up and saves submitted data to localStorage as a JSON string. When online connection is next restored, the app then re-sends the queued data to the server automatically. Once the data has been sent successfully, the item is then removed from localStorage.

    C’est une bonne idée de conserver en local toutes données avant de les envoyer au serveur, mobile ou pas. #spip