/** *浏览器判断 */ function getExplorer() { var explorer = window.navigator.userAgent; if (isIE()){ return "IE"; } //firefox else if (explorer.indexOf("Firefox") >= 0) { return "Firefox"; } //Chrome else if (explorer.indexOf("Chrome") >= 0) { return "Chrome"; } //Opera else if (explorer.indexOf("Opera") >= 0) { return "Opera"; } //Safari else if (explorer.indexOf("Safari") >= 0) { return "Safari"; } } function isIE() { //ie? if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; }