public
Created — forked from padolsey/gist:527683

Javascript: IE Detection

  • Download Gist
gistfile1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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;
}());

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.