Multi-Page Template

jQuery Mobile supports the ability to embed multiple pages within a single HTML document as shown in Listing 2–3. This strategy can be used to prefetch multiple pages up front and achieve quicker response times when loading sub-pages. As you can see in the example below, the multi-page document is identical to the single-page template we saw earlier except a second page has been appended after the first page. The multi-page specific details are highlighted and discussed below.

Listing 2–3. Multi-Page Template (ch2/multi-page.html)

<head>   <meta charset="utf-8">   <title>Multi Page Example</title>   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" type="text/css" href="jquery.mobile-min.css" ...

Get Pro jQuery Mobile 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.