var xmlhttpget;
try {
    // Firefox, Opera 8.0+, Safari
    xmlhttpget = new window.XMLHttpRequest();
}
catch (e) {
    // Internet Explorer
    try {
        //Internet Explorer 6.0+
        xmlhttpget = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            //Internet Explorer 5.5+
            xmlhttpget = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {
            alert("您的浏览器不支持AJAX!");
            return;
        }
    }
}
xmlhttpget.open("GET", url, false);
xmlhttpget.send(null);
var ajaxResult = xmlhttpget.response == undefined ? xmlhttpget.responseText : xmlhttpget.response;

相关文章:

  • 2022-12-23
  • 2022-02-17
  • 2021-06-16
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2021-12-05
  • 2022-12-23
  • 2021-11-16
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案