When data-ajax="false"
is set on a parent element, this is inherited by all the child elements. A filter method called jqmHijackable()
is available to search for child elements that can use custom forms and link binding. This recipe shows you how to use this method.
Copy the full code of this recipe from the code/09/jqmhijack
source folder. You can launch this code by using the URL: http://localhost:8080/09/jqmhijack/main.html
.
Add the following script to
main.html
before includingjquery.mobile.js
:$(document).bind("mobileinit", function() { $.mobile.ignoreContentEnabled = true; });
Add two anchor buttons to the page, as shown. The second button is within a
div
tag, which hasdata-ajax="false"
:<div data-role="content"> <div> <a href="page1.html" data-role="button">Link 1</a> </div> <div data-ajax="false"> <a href="page1.html" data-role="button">Link 2</a> </div> </div...