-
-
Save xincici/f06d626d9e1029b43b15 to your computer and use it in GitHub Desktop.
判断IE版本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isIE = (function(){ | |
var v = 3, | |
div = document.createElement('div'), | |
all = div.getElementsByTagName('i'); | |
//通过IE检测HTML条件注释方式 | |
//循环判断IE浏览器当前支持版本 | |
while ( | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', | |
all[0] | |
); | |
return v > 4 ? v : undefined; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment