readyState

Xmlhttp object reference
XMLHttpRequest object XMLHttpRequest member onreadystatechange readyState ResponseBody responsestream responseText responsexml status statustext about getallresponseheaders getresponseheader open send setrequestheader readyState
Returns the current status of the xmlhttp request
grammar
lValue = oXMLHttpRequest.readyState;
Example
Var XmlHttp;
XmlHttp = new ActiveXObject(“Msxml2.XMLHTTP.3.0”);
function send() {
XmlHttp.onreadystatechange = doHttpReadyStateChange;
XmlHttp.open(“GET”, “http://localhost/sample.xml”, true);
XmlHttp.send();
}
function doHttpReadyStateChange() {
if (XmlHttp.readyState == 4) {
alert(“Done”);
}
}
Remarks
Variable. This property is read-only. The status is represented by an integer with a length of 4. The definition is as follows:
0 (uninitialized) object established but not initialized (open method not called)
1 (initialization) object established, send method not called
2 (send data) send method called, but the current status and HTTP header are unknown
3 (in data transmission) part of the data has been received. Because the response and HTTP header are incomplete, there will be an error in obtaining part of the data through ResponseBody and responseText,
4 (completion) after receiving the data, you can obtain the complete response data through ResponseBody and responseText
Reference resources
Open method
ResponseBody property
ResponseText property
Send method
Status attribute
Statustext property

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值