支持IE7的XmlHttpRequest创建方法
2008-07-23 17:28
393 查看
function getXmlHttpRequest(){
if(window.ActiveXObject){
var ieArr=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
for(var i=0;i<ieArr.length;i++)
{
var xmlhttp= new ActiveXObject(ieArr[i]);
}
return xmlhttp;
} else if(window.XMLHttpRequest){
return new XMLHttpRequest();
}
}
if(window.ActiveXObject){
var ieArr=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
for(var i=0;i<ieArr.length;i++)
{
var xmlhttp= new ActiveXObject(ieArr[i]);
}
return xmlhttp;
} else if(window.XMLHttpRequest){
return new XMLHttpRequest();
}
}
相关文章推荐
- 封装支持FireFox与IE创建XMLHttpRequest方法
- 以支持多种浏览器的方式创建 XMLHttpRequest 对象
- 创建兼容于多浏览器支持的XMLHTTPRequest
- 创建XMLHttpRequest对象方法
- Ajax中封装创建XMLHttpRequest对象的方法
- 以支持多种浏览器的方式创建 XMLHttpRequest 对象
- 创建XMLHttpRequest对象并向服务器发送请求的方法
- JS不同浏览器创建xmlhttprequest对象的方法
- Ajax中封装创建XMLHttpRequest对象的方法
- 几种创建XMLHttpRequest对象的方法
- 转:使用 XMLHttpRequest 的创建方法
- 《一》以支持多种浏览器的方式创建 XMLHttpRequest 对
- 以支持多种浏览器的方式创建 XMLHttpRequest 对象
- Ajax创建XMLHttpRequest对象通用方法
- JS创建Ajax的XMLHttpRequest对象的通用方法
- 以支持多种浏览器的方式创建XMLHttpRequest对象
- 创建xmlHttpRequest对象在FireFox中支持Ajax
- 创建XmlHttpRequest对象的方法
- 创建XMLHttpRequest对象的通用方法
- 使用 XMLHttpRequest 创建方法的优缺点