Skip to content

Instantly share code, notes, and snippets.

@Lazerproof
Created January 19, 2016 04:47
Show Gist options
  • Save Lazerproof/e95beb0522c8289cf63c to your computer and use it in GitHub Desktop.
Save Lazerproof/e95beb0522c8289cf63c to your computer and use it in GitHub Desktop.
Javascript IE detection
function isIE () {
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}
if ( isIE () < 9 ) {
//is IE version less than 9
} else{
// Other versions IE or not IE
}
if ( isIE () == 9 ) {
//is IE version 9
} else{
// Other versions IE or not IE
}
if ( isIE() ) {
//is IE
} else{
// Other browser
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment