Last active
December 15, 2015 20:58
-
-
Save carlosrberto/5321955 to your computer and use it in GitHub Desktop.
A nice way to detect IE version
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 ie = (function(){ | |
var undef, v = 3, div = document.createElement('div'); | |
while ( | |
div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->', | |
div.getElementsByTagName('i')[0] | |
); | |
return v > 4 ? v : undef; | |
}()); | |
var msie = typeof ie !== "undefined" ? true : false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment