首页 > 代码库 > 判断IE和Edge

判断IE和Edge

//判断是否是IE浏览器,包括Edge浏览器
function IEVersion() {
var userAgent = navigator.userAgent;
if (!!window.ActiveXObject || "ActiveXObject" in window)
return "IE";
else if (userAgent.indexOf("Edge") > -1) {
return "Edge"
}
else {
return "-1";
}

}

判断IE和Edge