如何prevent做异步AJAX调用时,在结冰的Andr​​oid PhoneGap的应用程序?应用程序、AJAX、prevent、Andr

2023-09-10 16:09:19 作者:我们以前很好的,

我的PhoneGap,Android应用程序,我使用jQuery的。我做异步AJAX调用和通话过程中,应用程序只是冻结和AJAX调用完成后等待(其实主要是在GSM连接上显着)。

I have PhoneGap-Android app and I am using Jquery. I am doing ASYNCHRONOUS AJAX call and during the call, app just freezes and waits after AJAX call finish ( it is mainly noticeable when on GSM connection ).

我能明白这一点,如果我将做同步的请求,但我有:

I would understand this, if I would be doing synchronous request, but I have:

$.ajax({type: 'POST',url: 'http://www.example.com', data: data,async:true,success:callback});

任何人都可以帮忙吗?

Anybody can help ?

推荐答案

今天遇到同样的问题。通过使用setTimeout的具有10ms的延迟解决了这个问题。

Ran into the same problem today. Solved it by using a setTimeout with a 10ms delay.

不知道为什么它的工作原理,这是可怕的。但不工作。

Not sure why it works, which is scary. But does work.