Chapter 11. jQuery Mobile

According to jquerymobile.com, jQuery Mobile is an HTML5-based user interface system designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. But jQuery Mobile was mainly created for developing web applications for smaller screens.

To start learning jQuery Mobile, you need to know HTML, JavaScript, CSS, and jQuery. In some publications, you might see statements extolling how you can start using jQuery Mobile knowing only HTML. This is true until you run into the first unexpected behavior of your code, which you’ll inevitably encounter in one of the web browsers. (Take the statements about being a cross-browser framework with a grain of salt, too.) After that, you need to add some event listeners and scripts, and start debugging.

Obtaining jQuery Mobile

The jQuery Mobile website has all you need to start using this library. You can find lots of learning materials in the Demos section: tutorials, an API reference, and samples. The Download section contains links for the library itself.

There are two ways of including jQuery Mobile in the source code of your application: either download and uncompress the ZIP file in your local directory and specify this location in the source code of your application, or include the URLs of the content delivery network (CDN)–hosted files. Visit the jQuery Mobile Download page for the up-to-date URLs.

In our code samples, we’ll be adding the following code snippets, which ...

Get Enterprise Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.