Jquery mobile - onhashchange issue

后端 未结 2 1609
一向
一向 2021-01-24 15:33

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.h

2条回答
  •  孤城傲影
    2021-01-24 16:02

    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

提交回复
热议问题