Skip to content Skip to sidebar Skip to footer

Jquery Mobile - Onhashchange Issue

I am using $.mobile in my app. I must create my own routing system. I bind observer on hashchange and I pull out interesting data from location.hash. I have a problem - jQuery.mob

Solution 1:

I believe you are fighting against the "pushState" plugin in jQuery Mobile added in Beta 3 (I believe). You can disable this plugin with the following code (used before you include the jQuery Mobile JavaScript file):

$(document).on('mobileinit', function () {
    $.mobile.pushStateEnabled = false;
});

Check-out the documentation here (notice the "pushState Plugin" section): http://jquerymobile.com/demos/1.0rc3/docs/pages/page-navmodel.html


Solution 2:

in your html after including jquery and before including jquery.mobile-1.x.y.js add:

<script>
$(document).bind("mobileinit", function(){
        $.mobile.pushStateEnabled = false;
        $.mobile.ajaxEnabled = false;
        $.mobile.hashListeningEnabled = false;
});
</script>

Post a Comment for "Jquery Mobile - Onhashchange Issue"