分为四部分:
1、创建 XMLHttpRequest 对象 var xhr = new XMLHttpRequest();
2、向服务器发送请求,使用 xmlHttpRequest 对象的 open
3、发送send 方法,
4、监听状态变化,执行相应回调函数
let xhr = new XMLHttpRequest();
xhr.open("get",'aabb.php',ture);
xhr.onreadystatechange=function(){
if(xhr.readyState==4&&xhr.status==200){
console.log(xhr.statusText);
}
}