当我使用async=false
的async=true
方法时,open
和XMLHttpRequest
有什么区别?
function GetXML() {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = test
xmlhttp.open("GET", "PlanetCafe.xml", true);
xmlhttp.send(null);
}
最佳答案
Mozilla Developer: Synchronous and Asynchronous Requests
关于javascript - 同步请求和异步请求有什么区别? (异步= true/false),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15379474/