Skip to Content
jQuery Mobile: Up and Running
book

jQuery Mobile: Up and Running

by Maximiliano Firtman
February 2012
Beginner to intermediate
272 pages
6h 20m
English
O'Reilly Media, Inc.
Content preview from jQuery Mobile: Up and Running

Chapter 8. Installation and Offline Access

Using HTML5 and some other extensions, we can enable our jQuery Mobile application to work totally offline as if it were installed in the mobile device as a native app.

We can also package our jQuery Mobile webapp as a native app for store distribution, but that is for a later chapter. In this chapter we are creating an offline experience of our webapp without store distribution.

With this solution, the user can access our webapp from the mobile browser and then install it on her device. That means that next time she accesses the same webapp through the same URL or through an application icon, it will load from the local repository and not from our server.

Package Definition

The first thing to do is to define our package. To do that we are going to use an HTML5 API called Application Cache also known as Offline API available in the W3C draft.

This API does not currently work on every mobile browser but its compatibility includes most tablets and smartphones. You can check current compatibility of this API at http://mobilehtml5.org.

Our first step is to define what we want. Do we want a full offline application? Do we want some pages or data to be updated from the server every time? Do we want to have a local data cache and, if we have online access, update it?

The second step is to define the package. The package is a list of files that must be downloaded by the browser when the user accesses our website. This list must include every JavaScript, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

jQuery Mobile

jQuery Mobile

Jon Reid
jQuery in Action, Third Edition

jQuery in Action, Third Edition

Bear Bibeault, Yehuda Katz, Aurelio De Rosa

Publisher Resources

ISBN: 9781449331085Errata Page