Android平板电脑浏览器上的jQuery Ajax失败 [英] jQuery Ajax fails on Android tablet browser
问题描述
我正在使用三星平板电脑进行开发浏览器。
I am developing on a Samsung tablet which has default browser.
ISS告诉我这个信息:Mozilla / 5.0 +(Linux; + U; + Android + 3.2; + en-us; + GT-P7500 + Build / HTJ85B)
The ISS tells me this info : Mozilla/5.0+(Linux;+U;+Android+3.2;+en-us;+GT-P7500+Build/HTJ85B)
ajax调用因错误0而失败,并且在向服务器发布信息时没有信息。在其他所有浏览器上它都可以正常工作。
The ajax call keeps failing with Error 0 and no information when posting info to server. On every other browser it works without problems.
知道为什么?
这里是我使用的代码:
status is 0
end textStatus is undefined
here is the code i use : status is 0 end textStatus is undefined
$.ajax({
url: uri,
contentType: "application/json;charset=utf-8",
dataType: "text",
data: input,
type: 'POST',
error: function (jqXHR, textStatus, errorThrown) {
doShowError("Error:" + jqXHR.status + "--" + textStatus + "--" + errorThrown + "-"+ jqXHR.readyState);
}
}
编辑1: Mozilla / 5.0 +(Linux; + U; + Android + 3.2; + en-us; + GT-P7500 + Build / HTJ85B) + AppleWebKit / 534.13 +(KHTML,+ like + Gecko)+版本/ 4.0 + Safari / 534.13
这就是我得到的。
Edit 1 : Mozilla/5.0+(Linux;+U;+Android+3.2;+en-us;+GT-P7500+Build/HTJ85B)+AppleWebKit/534.13+(KHTML,+like+Gecko)+Version/4.0+Safari/534.13
this is all I get.
推荐答案
找到一个解决方案:
似乎在这个Webkit浏览器中异步处理时,从大响应中接收多个数据块时,浏览器回应s状态为0表示错误,而不是206表示部分结果。对我的案例的建议是我们应该使用同步来解决问题,直到修复此错误: http://code.google.com/p/android/issues/detail?id=14924 或此 http://bugs.jquery.com/ticket/8343
It seems that when doing things asynchronously in this Webkit browser, when receiving multiple chunks of data from a large response, the browser responds with status 0 which means error, instead of 206 which means partial result. The advice for my case is that we should used sync in order to fix the issue until this bug is fixed : http://code.google.com/p/android/issues/detail?id=14924 or this one http://bugs.jquery.com/ticket/8343
这篇关于Android平板电脑浏览器上的jQuery Ajax失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!