AJAX火狐和谷歌浏览器不兼容 10
AJAX火狐和谷歌浏览器不兼容functionXHR(){varxhr;try{xhr=newXMLHttpRequest();}catch(e){vara=['MSXM...
AJAX火狐和谷歌浏览器不兼容
function XHR(){
var xhr;
try{
xhr=new XMLHttpRequest();
}catch(e){
var a=['MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','MICROSOFT.XMLHTTP.1.0','MICROSOFT.XMLHTTP.1','MICROSOFT.XMLHTTP'];
for (var i=0;i<a.length;i++){
try{
xhr = new ActiveXObject(a[i]);
break;
}catch(e){}
}
}
return xhr;
}
function zyfanyi(){
var xhr=XHR();
xhr.open("GET", "tq.html", true);
xhr.onreadystatechange=function(){
if(xhr.readyState==4){
if(xhr.status==200){
$('tq').innerHTML = xhr.responseText;
}else{
}
}else{
}
}
xhr.send(null);
} 展开
function XHR(){
var xhr;
try{
xhr=new XMLHttpRequest();
}catch(e){
var a=['MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','MICROSOFT.XMLHTTP.1.0','MICROSOFT.XMLHTTP.1','MICROSOFT.XMLHTTP'];
for (var i=0;i<a.length;i++){
try{
xhr = new ActiveXObject(a[i]);
break;
}catch(e){}
}
}
return xhr;
}
function zyfanyi(){
var xhr=XHR();
xhr.open("GET", "tq.html", true);
xhr.onreadystatechange=function(){
if(xhr.readyState==4){
if(xhr.status==200){
$('tq').innerHTML = xhr.responseText;
}else{
}
}else{
}
}
xhr.send(null);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询