MCPcopy
hub / github.com/mynane/PDF / callback

Function callback

实用工具/xhr/xhr实现1.js:48–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47
48function callback(){
49 //在这里面没有使用this.readyState这是因为IE下面ActiveXObject的特殊性
50 /**
51 * 0(未初始化),对象已创建,但尚未初始化(尚未调用open方法)
52 * 1(初始化), 对象已创建,尚未调用send方法
53 * 2(发送数据), send方法调用,但是当前状态及http头未知
54 * 3(数据发送中), 已经接受到部分数据,因为响应及http头不全,这时通过responseBody和responseText获取部分数据会出现错误
55 * 4(完成), 数据接收完毕,此时可以通过通过responseBody和responseText获取完整的回应数据
56 */
57 if(xhr.readyState == 4) {
58 alert(xhr.reponseText);
59 }
60}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…