Created
January 16, 2015 16:48
-
-
Save cole007/a0c33ae130417f8f26fd to your computer and use it in GitHub Desktop.
msieversion
This file contains hidden or 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 msieversion() { | |
var ua = window.navigator.userAgent; | |
var msie = ua.indexOf("MSIE "); | |
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number | |
alert(parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))); | |
else // If another browser, return 0 | |
alert('otherbrowser'); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment