1
iPhone 5S, iOS 버전 8.1을 사용 중입니다. 일부 jquery ajax 호출이있는 웹 응용 프로그램을 디버깅 할 때 일관되게 내 error
콜백 메서드가 실행되고 있습니다. 나는 또한이 같은 높은 값 (20,000 같은 MS)에 제한 시간을 지정하려고 :
$.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 ;
}
}
})
을 영향을 미치지 않고, 전혀.
아무도 내 말에 무엇이 잘못 될 수 있는지 알려주세요.
도움이 될 수 있습니다 당신이 게시 한 작은 정보에서 당신은 –
나는 이해합니다. 사실, webservice 코드는 약간 거대합니다. –
BTW "async : false : call"에 대한 시간 제한을 설정할 수 없습니다. jQuery $ .ajax의 코드가이 문제를 방지합니다. - 일종의 표준이라고 생각합니다. – PandaWood