//创建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);
}