2011-11-22 3 views
1

IE6과 Firefox 7 사이에 다른 결과가 있습니다. Internet Explorer 6이 ActiveX 컨트롤을 사용하고 있고 다른 모든 것들이 XMLHttpRequest를 사용하고 있기 때문에 다른 브라우저에서 차이점이 많지 않을 수도 있습니다. 나는 XMLHttpRequest가 IE7까지 네이티브가 아니라고 생각한다.XMLHttpRequest.open 메서드에서 async 속성의 javascript 기본값은 무엇입니까?

IE6 ActiveXObject와 True Firefox 7에서 잘못된 것으로 보입니다.하지만 문서를 찾을 수없는 것 같습니다.

// one of these lines gets called - the first successful one 
obj = new XMLHttpRequest(); 
obj = new ActiveXObject("Msxml2.XMLHTTP.3.0"); 
obj = new ActiveXObject("Msxml2.XMLHTTP"); 
obj = new ActiveXObject("Microsoft.XMLHTTP"); 
// now later the code makes this call 
obj.open("GET",url); 
// notice how the third parameter [async] is not assigned 

제 질문은 위에서 설명한 여러 시나리오에서 비동기 속성의 기본값은 무엇입니까?

+2

jQuery를 사용하는 것이 좋은 이유입니다. – Joe

답변

2

기본값은 true입니다. docs.

또한 XMLHttpRequest 객체를 만드는 방법이 잘못되었습니다. obj 변수는 모든 문에 대해 덮어 쓰게됩니다. 적절한 방법은 this을 참조하십시오.

관련 문제