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:
Go to your project and copy (don't move or rename)
index.html
to a new file namedabout.html
.Next, edit the link we have for About Us to
about.html
(remember to do this in theindex.html
file as well).Now, change the
content
div element (<div data-role="content">
) ofabout.html
to say this:Founded in 2014, Anytown Civic Center plans to be the premier...