johna
johna

Reputation: 10772

jQuery Mobile ajaxEnabled doesn't work?

Running latest release of jQuery Mobile (1.0.1), and do not want to use AJAX for page navigation.

I added the following code which according to jQuery Mobile website should stop the use of AJAX:

$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});

But it still uses AJAX and adds the hash (# ) to URLs.

How can I disable the use of AJAX?

Upvotes: 9

Views: 8182

Answers (1)

Oiva Eskola
Oiva Eskola

Reputation: 949

Just a guess, but are you binding to mobileinit before jQuery Mobile is loaded?

As stated in the documentation, you'll want to load the JavaScript files in this order:

<script src="jquery.js"></script>
<script src="custom-scripting.js"></script>
<script src="jquery-mobile.js"></script>

Upvotes: 21

Related Questions