调用cordova.exec时,JqueryMobile动画不循环

时间:2013-04-15 15:28:59

标签: javascript jquery cordova jquery-mobile

所以我有一个按钮,当点击时,或多或少地调用cordova:

$(document).delegate("#update", "tap", A);

function A() {
  $.mobile.loading('show', {
        text: "Please Wait...",
        textVisible: true,
        theme: "a"
    });
setTimeout(function () {B();}, 100);
}

function B () {
cordova.exec(function(success) {  
        $.mobile.loading('hide');
    }, 
    function(error) {
        $.mobile.loading('hide');
    }, 
    "MyPlugin",
    "MyAction",    [""]);
}

当我点击按钮时,它会加载jQueryMobile动画,但是当调用cordova时,动画停止循环并且让人感觉应用程序崩溃了。 我看到的每个地方都说调用插件是异步的,但看起来并不像那样。

感谢您的帮助。

0 个答案:

没有答案