Jquery mobile jquerymobile。在页面更改时加载消息

Jquery mobile jquerymobile。在页面更改时加载消息,jquery-mobile,cordova,page-loading-message,Jquery Mobile,Cordova,Page Loading Message,我正在使用Phonegap+JQM构建脱机应用程序。是否有可能全局设置每个页面更改事件都会显示加载消息?Nirmal的回答对我不起作用,但绑定到各个页面会: $(document).live('pagebeforehide', function(){ $.mobile.showPageLoadingMsg(); //More stuff to do }); $(document).live('pageshow', function(){ //More stuff to

我正在使用Phonegap+JQM构建脱机应用程序。是否有可能全局设置每个页面更改事件都会显示加载消息?

Nirmal的回答对我不起作用,但绑定到各个页面会:

$(document).live('pagebeforehide', function(){
    $.mobile.showPageLoadingMsg();
    //More stuff to do
});

$(document).live('pageshow', function(){
    //More stuff to do
    $.mobile.hidePageLoadingMsg();
});
$("div[data-role='page']").live('pagebeforehide', function(){
    console.log("showing....");
    $.mobile.showPageLoadingMsg();
    //More stuff to do
});

$("div[data-role='page']").live('pageshow', function(){
    //More stuff to do
    console.log("hiding....");
    $.mobile.hidePageLoadingMsg();
});

我遇到了这种错误,然后我启动了这个解决方案“UncaughtTypeError:Object”没有方法“hidePageLoading”