O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

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

Creating a Back Button

<a data-rel="back data-role="button"   class="ui-btn-right">Next</a></div>

Another useful feature included in jQuery Mobile is the ability to define a navigation button as a back button. A back button uses the browser history to navigate to the previous button mobile page. To define a link as a back button, you need to add the data-rel="back" attribute. For example:

<a data-rel="back data-role="button" class="ui-btn-right">Next</a></div>

Notice that there is not an href attribute. That is because the href attribute will be ignored; instead, the most recent URL will be popped off the browser’s navigation history list.

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