Created
January 19, 2016 04:47
-
-
Save Lazerproof/e95beb0522c8289cf63c to your computer and use it in GitHub Desktop.
Javascript IE detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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