내 아약스 코드입니다 :아약스 준비 상태는 4 reachs하지만 상태는 항상 200
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
alert(xhr.status);
if (xhr.status == 200) {
alert("200");
}
else if (xhr.status == 8001) {
alert("8001");
}
else if (xhr.status == 8000) {
alert("8000");
}
else if (xhr.status == 7000) {
alert("7000");
}
else {
alert("x");
}
}
};
xhr.open("POST","URL",true);
xhr.send(null);
내가 xhr.open에서 해결 페이지에서 내 코드입니다 : 그것은 파이어 폭스에서 작동
if (request.getSession().getAttribute("SATI_UID") == null) {
response.sendError(8000);
} else {
response.sendError(8001);
}
그리고 크롬 그리고 ie 그러나 원정 여행에서 나는 항상 상태 200을 얻는다. 나는 사파리를 사용한다 5.1.7. 또한 response.sendError
대신 response.setStatus
을 사용하지만 작동하지 않습니다. 왜 이런 일이 발생하는지 알고 있습니까?