우선 - 서버 측 오류를 제외하기 위해 응답 객체와 함께 성공 이벤트 콜백을 사용하고 있는지 확인하십시오.
$.ajax({
//... other ajax options
success: function(response){
alert(response);
}
});
귀하의 PHP 스크립트는 이러한 성공의 기능에 대한 응답을 울리는 본질적으로입니다.
$.ajax({
//...other ajax options...
timeout: 5000 //5 second timeout
});
: 그것은 "실패"심지어
JSON/
XML 문자열
둘째 ...
당신은 그 오류를 배제하기 위해 시간 제한 옵션을 설정할 수 있습니다, 간단한 문자열 "성공"수
셋째 ...
당신은 어떤 예외에 대한 오류 이벤트 콜백을 사용할 수 있습니다 ...
$.ajax({
error: function(XMLHttpRequest, textStatus, errorThrown){
//handle errors here
}
});
A function to be called if the request fails. The function is passed three arguments: The XMLHttpRequest object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "notmodified" and "parsererror". This is an Ajax Event . This handler is not called for JSONP requests, because they do not use an XMLHttpRequest.
다음
jQuery docs on ajax
오류에서