HTML and CSS Reference
In-Depth Information
• Storing data on the client side with the Web Storage API
• Managing a full client-side IndexedDB database
• Enabling applications to work offline with the Application Cache API
HTML5 is finally providing the web with a solution to the problem of working offline. Al-
though a plethora of solutions for saving web pages for later use in an offline environment
already exist, until now there's been no solution for using web applications in such a man-
ner. By allowing web applications to store data locally on the client, HTML5 now enables
web applications to work without a constant connection to a central server.
When might this be useful? Think of a sales representative in the field being able to use
his firm's customer relationship management application on the go, even in areas with poor
network coverage, such as a remote location or an underground train. With the new cap-
abilities provided by HTML5, that rep can still use the application in such areas, viewing
data that has already been downloaded to the device, and even being able to enter new data,
which is stored temporarily on the device and synchronized back to the central server when
the network is available again. Also, think of an HTML5 game like the ones you will build
in chapters 6 and 7 . Rather than storing game saves and state data on a server, you can in-
crease performance and reduce latency and load by saving the data locally. One feature in
particular—the application cache manifest—gives you the ability to create a game that can
be run completely offline.
In this chapter, we're going to show you how to put these features and concepts into prac-
tice by building a simple mobile web application called My Tasks. This application, which
will be fully functional when the user is offline, will create, update, and delete tasks that are
stored locally in the browser. In addition, My Tasks will allow the user to change settings
for the application's display.
Why build the sample My Tasks application?
While working through this chapter's sample application, you'll learn how to
• Store data on the client side using the Web Storage API
• Store data on the client side using the IndexedDB database
• Use the application cache manifest file to build web applications that will function
while offline
Search WWH ::




Custom Search