Skip to content

Instantly share code, notes, and snippets.

@argshook
Created November 14, 2013 10:00
Show Gist options
  • Save argshook/7464315 to your computer and use it in GitHub Desktop.
Save argshook/7464315 to your computer and use it in GitHub Desktop.
Super tiny IE browser detection in javascript. Works as expected with IE 4, 5, 5.5, 6, 7, 8, 9 & 10. Also makes you warm inside.
var isMSIE = /*@cc_on!@*/0;
if (isMSIE) {
document.body.style.background = "red"; //it's IE :(
} else {
document.body.style.background = "green"; //it's not IE!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment