Architecture

jQuery Mobile uses a very simple and powerful approach to define the content of the webapp. Remember that we’ve already discussed that the framework uses an unobtrusive approach, meaning that our HTML documents will work even without jQuery Mobile loading properly.

The main unit of the framework is the page. Just like normal HTML files then? No. Let me explain. A page is just a div element with a specific role. One HTML document can host one page or many pages inside the same file. And that is a new concept for most web designers.

We will be able to link to pages inside the same HTML document, or to pages on external HTML documents, using simple HTML markup, such as the a tag.

Roles

jQuery Mobile uses standard HTML markup, such as the div tag. To define what the framework should do with that div, we define a role. A role in the framework is defined using the attribute ...

Get jQuery Mobile: Up and Running 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.