var xmlRequest; if(window.ActiveXObject){ /*支持IE浏览器*/ xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); }else if(window.XMLHttpRequest){ /*支持Firefox, chrome, safari等*/ xmlRequest = new XMLHttpRequest(); }