ajax(3)---Conmon.js
时间:2014-05-14 23:07:47
收藏:0
阅读:498
//创建xhr对象 兼容方式
function createXmlHttp() {
var xhobj = false;
try {
xhobj = new ActiveXObject("Msxml2.XMLHTTP"); // ie
msxml3.0+
} catch (e) {
try {
xhobj = new
ActiveXObject("Microsoft.XMLHTTP"); //ie msxml2.6
} catch (e2) {
xhobj = false;
}
}
if (!xhobj &&
typeof XMLHttpRequest != ‘undefined‘) {// Firefox, Opera 8.0+, Safari ,ie10
xhobj = new XMLHttpRequest();
}
return xhobj;
}
//根据Id获取元素对象
function gel(id){
return
document.getElementById(id);
}
评论(0)