我在使用适用于 Windows Phone 和 jQuery 的 Phonegap 时遇到问题。
我有一个Ajax请求到远程服务器,但是即使服务器响应200代码,成功回调也不会执行(我可以在服务器access_log中看到该请求)。错误回调也不会执行。
代码
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
$.ajax({
url: 'http://example.com',
data: { foo: 'bar' },
cache: false,
dataType: 'json',
success: function (data) {
console.log(data);
}
});
有什么想法吗?
最佳答案
我有同样的问题,但不是这个建议,新版本的phonegap也没有帮助。使用phonegap 1.4.0,我现在总是收到错误回调。
关于jquery - Windows Phone 的 Phonegap jQuery ajax 回调未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9031968/