`
piperzero
  • 浏览: 3472432 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

得到XmlHttpRequest对象封装的函数,支持ie和firefox

 
阅读更多

得到XmlHttpRequest对象封装的函数,支持ie和firefox

<script>

function createXMLHttp()
{
var ret = null;
try {
ret = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e) {
try {
ret = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (ee) {
ret = null;
}
}
if (!ret && typeof XMLHttpRequest != 'undefined')
ret = new XMLHttpRequest();

return ret;
}

</script>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics