내 프로젝트에서 긴 폴링을 사용하고 있습니다. 프로젝트가 실행 중일 때 긴 폴링 요청 중 하나는 서버의 응답을 기다리는 것입니다. 이제 사용자가 새 템플릿을 생성하면 이전의 긴 폴링 호출을 중단하고 새 폴링 호출을 실행해야합니다. IE에서 중단IE9에서 AJAX 요청을 중단 할 때 오류 발생
오류
couldn't complete the operation due to error c00c023f
내가 jQuery를 사용하지 않으
이전 요청을 중단하는 것은 매우 중요에게 제공합니다. Try and Catch를 시도하여이 오류를 표시하지 못하도록했지만 작동하지 않았습니다.
정상적인 요청 (폴링 요청 아님) 요청이 몇 초 후에 서버에 도달하지 못하면 중단을 사용하고 이전 요청을 중단하고 새 요청을 보냅니다.
각 요청마다 xmlHttp 객체를 배열에 저장합니다. 다른 모든 브라우저에서 완벽하게 작동하는 동안, 나는 IE9에 대한 해결책을 찾을 수 없습니다 array_XMLHttp[index_of_request].abort();
:
처럼 : array_XMLHttp.push(request1);
나는처럼 중단.
업데이트 : 나는 항상 다음과 같이 XMLHTTP 개체의 상태와 readyState가를 확인
:
function checkResponse(xmlHttp){
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
// Request received
}
}
}
}
다음
내가 요청을 시작하는 방법입니다
// to start new XmlHttp object
var xmlHttp=crXH();
// add the request to array to be aborted later if required
array_XMLHttp.push(request1);
// initiate the callback
checkResponse(xmlHttp);
//send the request to server
send(xmlHttp);
나는 중지하는 경우 :
// The problem now the callback function will not read (undefined) the new property added to the aborted object.
array_XMLHttp[index_of_request].aborted = true;
array_XMLHttp[index_of_request].abort();
여러분의 도움에 감사드립니다! 나는이 주제에 발견했습니다 various articles like this one 당 대답에 우리의 긴 토론을 성문화
가능한 중복 : HTTP : // 유래 .com/questions/7287706/ie-9-javascript-error-c00c023f – jfriend00
해결 방법 : http://answer.techwikihow.com/368561/script575-complete-operation-due-error-c00c023f.html – jfriend00
그것이 중복이라고 생각하지 않습니다. 요청을 중단하면 오류가 발생합니다. 고마워. 내가 살펴볼거야. – moderns