ajax 使用注意

使用ajax的时候一定要加上网络协议无论是http 还是 https 浏览器的地址栏会自动填充

ajax的实例对象可以多次使用吗?经过测试一个实例后的XMLHttpRequest对象是可以多次使用的

let xhr = new XMLHttpRequest();
xhr.open("GET","http://localhost:8888/testList",true);
xhr.onload = function(){
    console.log(xhr.response,1);
}
xhr.send();
			
xhr.open("GET","http://localhost:8888/testArr",true);
xhr.onload = function(){
    console.log(xhr.response,2);
}
xhr.send();