Ajax中创建请求的浏览器兼容性。
第一个是非IE浏览器
第二个是大多数IE浏览器支持的
第三个是低版本的IE支持的 5 6
function creatRequest() {
try {
request = new XMLHttpRequest();
} catch (tryMS) {
try {
request = new ActiveXObject(“Msxml2.XMLHTTP”);
} catch (otherMS){
try{
request = new ActiveXObject(“Microsoft.XMLHTTP”);
}catch(failed){
request = null;
}
}
}
return request;
}