Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Installation and Offline Access > Storing Offline Data

Storing Offline Data

To store information locally while we are offline—or even online but we don’t want to use AJAX— HTML5-related technologies offer us three options:

  • Web Storage API

  • Web SQL Database API

  • IndexedDB API

Tip

You can check current compatibility of every HTML5-related API on http://mobilehtml5.org.

In this book we are going to use the Web Storage API because it’s the simplest one and the most compatible API between A-grade jQuery Mobile browsers. This is a very simple API supporting two key-value based collections: localStorage and sessionStorage.

localStorage is a collection of strings stored persistently on the device and sessionStorage is pretty similar but it is removed from the system when the browser is closed.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint