日期:2014-05-16 浏览次数:20638 次
var xmlhttp; function createRequest() { if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } } createRequest(); function sendRequest() { if(xmlhttp) { xmlhttp.open("GET", "URL", true); xmlhttp.send(null); xmlhttp.onreadystatechange = getRequestAndManager; } } function getRequestAndManager() { if (xmlhttp_request.readyState == 4) {// 收到完整的服务器响应 if (xmlRequest.status == 200) { var requestReturnStr = xmlhttp.responseText; var json = eval("("+requestReturnStr+")"); } } }