关于ajax状态<4的问题 - Web 开发 / Ajax
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script language="javascript" type="text/javascript"> //ajax xhttp var xmlHttp = false; try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { xmlHttp = false; } } if (!xmlHttp && typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } function callServer() { var Rid = 3; var Star_Time="2010-03-25"; var End_Time="2010-03-30"; var url ="getRoom_Price.asp?rid=" +escape(Rid)+"&DStar_Time="+escape(Star_Time)+"&DEnd_Time="+escape(End_Time); alert(url); xmlHttp.open("GET", url, true); xmlHttp.onreadystatechange = buildTextArea; xmlHttp.send(null); } function buildTextArea(){ if(xmlHttp.readyState < 4) { alert("状态小于4"); } if(xmlHttp.readySate == 4) {//xmlHttp Star alert("状态=4"); if(xmlHttp.status!=200) { alert("状态不等于200"); } else { alert("状态=4 <200"); } } }</script></head><body> <table width="500" border="0" cellspacing="0" cellpadding="0" id="AAAA"> <tr> <td> </td> </tr></table><input type="button" onClick="callServer()" value="Submit111"/></body></html>