在head first js上看到创建XMLHttpRequest对象var request = null ;
if(window.XMLHttpRequest){
try{
request = new XMLHttpRequest();
} catch(e){
request = null;
}
}else if(window.ActiceXObject){
try{
request = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
request = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
request = null;
}
}
}
在W3c上看到
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}请问这一串是针对哪类浏览器,或者说它是干嘛用的,new ActiveXObject("Msxml2.XMLHTTP");w3c上没有是代表它已经过时了吗?
添加回答
举报
0/150
提交
取消