Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 957
johna Avatar asked Feb 24 '12 03:02

johna


Video Answer


1 Answers

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>
like image 68
Oiva Eskola Avatar answered Sep 30 '22 09:09

Oiva Eskola