Jquery mobile - onhashchange issue

女生的网名这么多〃 提交于 2019-12-02 04:29:08

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

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!