如何解决JSCallback Server关闭:停止回调

时间:2012-06-13 12:22:35

标签: javascript android jquery-mobile callback cordova

嗨,我收到错误消息

当我调用HTML文件时,我正在使用此方法

url:'http://abcccc/'+data.userId,
success:function(userInfo){
$.cookie('iTouchUser', JSON.stringify(userInfo));
// window.location='list.html';    (i've try this method also)
window.location.replace('file:///android_asset/www/list.html');

我得到的错误信息是

 DroidGap(991): DroidGap.loadUrl(file:///android_asset/www/list.html)
 DroidGap(991): DroidGap: url=file:///android_asset/www/list.html baseUrl=file:///android_asset/www/
 PluginManager(991): init()
 CordovaLog(991): JSCallback Server Closed: Stopping callbacks.
 CordovaLog(991): file:///android_asset/www/cordova-1.8.0.js: Line 3708 : JSCallback Server Closed: Stopping callbacks.
 Web Console(991): JSCallback Server Closed: Stopping callbacks. at file:///android_asset/www/cordova-1.8.0.js:3708

我已经在cordova-1.8.0.js:3708中检查了它

// If server is stopping
          else if (xmlhttp.status === 503) {
              console.log("JSCallback Server Closed: Stopping callbacks.");
          } 

任何人都知道如何解决此错误

1 个答案:

答案 0 :(得分:1)

对于Android,请尝试使用navigator.app.loadUrl('url')代替window.location