Skip to content

Instantly share code, notes, and snippets.

@rayfranco
Forked from padolsey/gist:527683
Created March 12, 2012 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rayfranco/2020976 to your computer and use it in GitHub Desktop.
Save rayfranco/2020976 to your computer and use it in GitHub Desktop.
Javascript: IE Detection
var ie = (function(){
var undef,
v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : undef;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment