Book Image

jQuery Mobile Web Development Essentials-Third Edition - Third Edition

By : Raymond Camden, Andy Matthews
Book Image

jQuery Mobile Web Development Essentials-Third Edition - Third Edition

By: Raymond Camden, Andy Matthews

Overview of this book

jQuery Mobile is a HTML5-based touch-optimized web framework. jQuery Mobile can be used to build responsive cross-platform websites and apps for a wide range of smartphones, tablets, and desktop devices. The jQuery Mobile framework can be integrated with other mobile app frameworks such as PhoneGap, IBM Worklight, and more. Introduction to jQuery Mobile explains how to add the framework to your HTML pages to create rich, mobile-optimized web pages with minimal effort. You’ll learn how to use jQuery Mobile’s automatic enhancements and configure the framework for customized, powerful mobile-friendly websites. We then dig into forms, events, and styling. You'll see how jQuery Mobile automatically enhances content, and will find out how to use the JavaScript API to build complex sites. We’ll introduce you to how jQuery Mobile can be themed as well looking into how JavaScript can be used for deep sets of customizations. The examples are ready to run and can be used to help kick-start your own site. Along the way, you will leverage all the concepts you learn to build three sample mobile applications.
Table of Contents (20 chapters)
jQuery Mobile Web Development Essentials Third Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

jQuery Mobile and URLs


If you've opened test2.html in your browser and played with it, you may have noticed something interesting about the URLs as you navigate. The following is the initial http://localhost/mobile/c2/test2.html URL (the address and folder will, of course, differ on your computer).

After clicking on Products, the URL will change to http://localhost/mobile/c2/products.html. If I click on back and click on learn more, I will get http://localhost/mobile/c2/test2.html#aboutPage.

In both the subpages (the Products page and the About page), the URL was changed by the framework itself. The framework uses history.pushState and history.replaceState in the browsers that support it. For older browsers, or browsers that don't support JavaScript manipulation of the URL, hash-based navigation is used instead. The http://localhost/mobile/c2/test2.html#/mobile/c2/products.html URL is an example of how this link would look.

What's interesting is that, in this bookmark style, test2.html is always...