Skip to content

Instantly share code, notes, and snippets.

@cjmyles
Last active August 29, 2015 13:57
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 cjmyles/9357483 to your computer and use it in GitHub Desktop.
Save cjmyles/9357483 to your computer and use it in GitHub Desktop.
Utils - Internet Explorer version
utils = {
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]
);
if (Function("/*@cc_on return document.documentMode===10@*/")()){
v = 10;
}
return v > 4 ? v : undef;
})()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment