判断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";
}

}

posted @ 2016-11-13 21:36  晓明的哥哥  阅读(2024)  评论(0编辑  收藏  举报