반응형
function get_ie_ver()
{
var str, version = "";
var agent = navigator.userAgent.toLowerCase();
if(navigator.appName == "Microsoft Internet Explorer") str = "msie "; // IE old version(IE 10 or Lower)
else if(agent.search("trident") > -1) str = "trident/.*rv:"; // 11
else if(agent.search("edge/") > -1) str = "edge/"; // edge
else return -1; // ie가 아니면
var reg = new RegExp(str + "([0-9]{1,})(\\.{0,}[0-9]{0,1})");
if(reg.exec(agent) != null) version = RegExp.$1 + RegExp.$2;
return parseInt(version, 10);
}
반응형