当前位置 : 主页 > 网络编程 > JavaScript >

原生态 Ajax 温习

来源:互联网 收集:自由互联 发布时间:2021-06-28
ajax-get.txt var ajax = new XMLHttpRequest();ajax.open('get', 'http://pauli.cn');ajax.send();ajax.onreadystatechange = function () {if (ajax.readyState == 4 ajax.status == 200) { console.log(ajax.responseText); }}
ajax-get.txt
var ajax = new XMLHttpRequest();
ajax.open('get', 'http://pauli.cn');
ajax.send();
ajax.onreadystatechange = function () {
if (ajax.readyState == 4 && ajax.status == 200) {
    console.log(ajax.responseText);
  }
}
网友评论