使用Ipad(IOS 7.1)操作Ajax调用时遇到困难以下代码适用于IE,FF和Chrome,但不适用于安装在Ipad上的Safari(IOS 7.1).
$.support.cors = true;
$.ajax(
{
type:'GET',
dataType: 'json',
contentType: "application/json; charset=utf-8",
headers: { "cache-control": "no-cache" },
timeout: 5000,
url:'mydomaine',
crossDomain:true,
cache:false,
async:true,
success: function(data) {alert("OK");},
error:function(xhr, status, errorThrown) {alert("OK");}
});
用iPad(IOS 7.1)调用此代码时,出现以下错误
xhr.status: 0
xhr.statusText: error
xhr.readyState: 0
xhr.responseText:
xhr.responseXML: undefined
textStatus: error
errorThrown:
xhr.redirect: undefined
我使用了以下JS库
注意:t注意GET和POST类型出现问题,但PUT没有出现问题.
另外,服务器执行http查询.对我来说,问题在于Safari浏览器对Response的处理.
你能帮助我吗 ?