gpt4 book ai didi

jquery - IOS 8.1 Safari :$. ajax 给出超时错误 dom 异常 23

转载 作者:行者123 更新时间:2023-12-01 06:45:52 24 4
gpt4 key购买 nike

我使用的是iPhone 5S,运行iOS 版本8.1。当我调试具有一些 jquery ajax 调用的 Web 应用程序时,我始终会执行我的 error 回调方法。我还尝试将超时指定为一个较高的值(例如 20,000 毫秒),如下所示:

$.ajax({
type: "POST",
url: serviceURL,
data: userInputjson,
contentType: "application/json; charset=utf-8",
datatype: "json",
async: false,
timeout: 20000,
complete: function (msg) {

if(msg.responseJSON) {
msg = msg.responseJSON;
alert('msg.responseJSON exists');
console.log(msg);

if (msg.Status == 'SUCCESS') {
var obj = JSON.parse(userInputjson);
var firstName,lastName,email;
for(i=0; i< obj.fields.length; i++){
if(obj.fields[i].Key =="FirstName")
{
firstName = obj.fields[i].Value;

}else if(obj.fields[i].Key =="LastName"){
lastName = obj.fields[i].Value;

}else if(obj.fields[i].Key =="Email"){
email = obj.fields[i].Value;

}
}
alert("before cookie");
$.cookie(DHLoginCookieName, {
firstName: firstName,
lastName: lastName,
emial:email,
isLoggedIn: true
});
alert("after cookie");
window.top.location.href = "thankyou.html";
}
else
{
alert("in else");
$(".regLoader").hide();
$("#submiterror").show();
}

return false;
}
},
error: function (xmlHttpRequest, textStatus, errorThrown) {alert("Error status 2: "+textStatus+"\n"+errorThrown);
if (xmlHttpRequest.readyState == 0 || xmlHttpRequest.status == 0) {
$(".regLoader").hide();
$("#submiterror").show();
return ;
}
}
})

没有任何效果。

任何人请告诉我我这边可能出了什么问题。

最佳答案

async: false 更改为 async: true ,可能会有所帮助

关于jquery - IOS 8.1 Safari :$. ajax 给出超时错误 dom 异常 23,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27903513/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com