my ajax code is:
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);
and my code in page that i addressed in xhr.open is:
if (request.getSession().getAttribute("SATI_UID") == null) {
response.sendError(8000);
} else {
response.sendError(8001);
}
it works in firefox and chrome and ie but in safari i always get status 200.
i use safari 5.1.7. i also use response.setStatus
instead of response.sendError
but it's not working.
anybody knows why this happens?