当我使用async=falseasync=true方法时,openXMLHttpRequest有什么区别?

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/

10-12 12:29
查看更多