ajax error ios,错误(状态0)jQuery ajax与Safari和ios 7

使用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的处理.

你能帮助我吗 ?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值