作者:80后之多管闲事 | 来源:互联网 | 2023-05-16 09:34
imdevelopingaPhoneGapapplication,itsworkingfineinmycomputerbrowserandintheiOSsimul
i'm developing a PhoneGap application, it's working fine in my computer browser and in the iOS simulator, but the UI is freezing while calling asynchronous AJAX on devices (iPhone and Android).
我正在开发一个PhoneGap应用程序,它在我的计算机浏览器和iOS模拟器中运行良好,但在设备(iPhone和Android)上调用异步AJAX时,UI正在冻结。
For instance, I'm using animated GIF images to show my user that the content is loading, I've got 10 simultaneous calls done, but the UI is waiting the 10 calls to be finished before changing the content of the screen. The problem is that the loading animation is not even done.
例如,我正在使用动画GIF图像向我的用户显示内容正在加载,我已完成10个同时调用,但UI正在等待10个调用完成,然后才更改屏幕内容。问题是加载动画甚至没有完成。
This is my ajax call:
这是我的ajax电话:
GetContribution: function(me, id) {
$.ajax({
cache: false,
async: true,
type: "GET",
dataType: "json",
url: AN_URL,
data: 'id='+id+'&type=0',
contentType: "application/json;charset=utf-8",
accept: "application/json",
beforeSend: configureHeader,
success: function (data) {
me.set(data.GetContributionResult);
me.setPZLoaded(true);
me.grabContributions();
me.trigger('change');
},
error: function (r) {
console.log(r);
}
});
},
Is there something special to do for asynchronous calls on PhoneGap?
在PhoneGap上进行异步调用有什么特别之处吗?
Thanks for your help.
谢谢你的帮助。
Cyril
1 个解决方案