function CreateXmlHttp() { //非IE浏览器创建XmlHttpRequest对象 if(window.XmlHttpRequest) { xhr=new XmlHttpRequest(); } //IE浏览器创建XmlHttpRequest对象 if(window.ActiveXObject) { try { xhr=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { try { xmlhttp=new ActiveXObject("msxml2.XMLHTTP"); } catch(ex){} } } }