
120 ◾ PhoneGap Build
Handling Page Navigation
Unlike traditional Web pages, where each Web page is maintained in a separate HTML file, in
mobile programming, multiple pages are defined into a single HTML file. e idea is that once
the file is loaded, all the contained pages can be navigated without network requests.
We can define multiple pages in an application by using the data-role attribute. By assign-
ing a page value to the data-role attribute for more than one, we can define multiple pages.
For example, the following code defines two pages, Home and Page 2, in an application:
<!—Home Page—>
<div data-role = "page" id = "home">
<div data-role = "header"> ...