Book Image

Mastering jQuery Mobile

Book Image

Mastering jQuery Mobile

Overview of this book

Table of Contents (17 chapters)
Mastering jQuery Mobile
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Links and page navigation


When the jQuery Mobile framework encounters a link, it loads up the link in one of the following two ways: Ajax or non-Ajax.

Ajax page linking

By default, whenever you create a link, the framework will automatically load the link using Ajax. By using Ajax, this allows you to have animated page transitions. Again, this is by default, so you don't have to do anything to your link. The framework parses the anchor tag's href attribute and automatically loads the target into the DOM. If it fails, an error message stating Error Loading Page will display briefly on the screen.

Let's go ahead and see an Ajax link in action:

  1. Go to your project and copy (don't move or rename) index.html to a new file named about.html.

  2. Next, edit the link we have for About Us to about.html (remember to do this in the index.html file as well).

  3. Now, change the content div element (<div data-role="content">) of about.html to say this:

    Founded in 2014, Anytown Civic Center plans to be the premier...