Jquery mobile 在JQM中以编程方式更改页面

Jquery mobile 在JQM中以编程方式更改页面,jquery-mobile,Jquery Mobile,我有一个jQuery Mobile 1.3.0应用程序和一些页面。我在index.html中有一个页面menyside,我已将事件绑定到该页面: $(document).on('pagebeforeshow', '#menyside', function(event){ // check local storage, and some times do this: $.mobile.changePage("otherPage.html", { transition: "s

我有一个jQuery Mobile 1.3.0应用程序和一些页面。我在index.html中有一个页面menyside,我已将事件绑定到该页面:

$(document).on('pagebeforeshow', '#menyside', function(event){
        // check local storage, and some times do this:
    $.mobile.changePage("otherPage.html", { transition: "slideup"} );
}
});
我检查本地存储中的一些值,并根据这些值以编程方式更改页面。这在我第一次打开应用程序时有效,但在我重新打开应用程序时无效,即文档已加载到浏览器中,但已重新加载


我是否绑定到错误的事件?我试图查看文档中的事件,但没有找到更好的…

menyside是您页面的id吗?因为如果是的话,你的代码里就没有任何东西了。您收到任何错误吗?@Gajotres:是的,menyside是index.html中的页面。我看不出有任何错误。我认为这只发生在移动设备上,而不是桌面浏览器上。