// IE9及以上
const xhr = new XMLHttpRequest()
// IE9以下(IE7、IE8也不报错,但是能用的功能极少)
const xhr = new ActiveXObject('Microsoft.XMLHTTP;')
//兼容写法
if(window.XMLHttpRequest){
var xhr=new XMLHttpRequest();
}else{
var xhr=new ActiveXObject("Microsoft.XMLHTTP;");
};