Skip to content

@k9ordon /gist:582281 forked from padolsey/gist:527683
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// if (ie) { alert('IE ' + ie); } // else ie version is not a number;
// if(!ie) { alert ('IE is Kryptonite.'); }
var ie = (function(){
var div = document.createElement('div');
for (v=6;v<=9;v++)
div.innerHTML += '<!--[if IE ' + v + ']>' + v + '<![endif]-->'
return parseInt(div.innerHTML);
}());
@k9ordon
Owner

if(!ie) { alert ('IE is Kryptonite.'); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.