Adding multiple pages to one file
In the previous chapter, we worked on a file that had a simple page of text. For our first modification, we're going to add another page to the file and create a link to it. If you remember, jQuery Mobile looks for a particular <div>
wrapper to help it know where your page
is: <div data-role="page">
. What makes jQuery Mobile so simple to use is that we can add another page by simply adding another div
using the same format. The code snippet Listing 2-1
shows a simple example of this feature:
Listing 2-1: test1.html <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Multi Page Example</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"><...