用js代码判断是否IE浏览器

判断是否IE的方法:

var isIE = function(ver) {
		var div = document.createElement("div"), status;
		div.innerHTML = "<!--[if IE " + ver + "]><i></i><![endif]-->";
		status = (div.getElementsByTagName("i").length === 1);
		document.body.appendChild(div);
		div.parentNode.removeChild(div);
		return status;
	}
原文地址:https://www.cnblogs.com/guxingzhe/p/5461996.html