O'Reilly logo

jQuery Mobile Web Development Essentials Second Edition by Andy Matthews, Raymond Camden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with back buttons

Depending on your user's hardware, they may or may not have a physical back button. For devices that do, such as Android phones, hitting the back button will work just fine in a jQuery Mobile application. Whatever page the user was on previously will be loaded as soon as the button is clicked. But on other devices, like the iPhone, there is no such button to click. While you can provide links to navigate around pages yourself, jQuery Mobile provides some nice built in support for navigating backwards out of the box.

There are two ways you can add an automatic back button. code 3-4 shows a simple, two page jQuery Mobile site. In the second page, we've added a new data attribute, data-add-back-btn="true". This will create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required