使用ie条件判断conditionals获取ie具体版本号
1、获取方法
var ieVersion = document && (function() { var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i');// Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment
while (
div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',
iElems[0]
) {}
return version > 4 ? version : undefined;
}());
2、注意点
ie10以上不支持 conditional comments
标题:使用ie条件判断conditionals获取ie具体版本号
作者:hugh0524
地址:https://blog.uproject.cn/articles/2017/06/01/1496303975257.html
0 0