Skip to content

Instantly share code, notes, and snippets.

@thealscott
Created January 7, 2015 17:26
Show Gist options
  • Save thealscott/41aaa8fc755f67ffaab8 to your computer and use it in GitHub Desktop.
Save thealscott/41aaa8fc755f67ffaab8 to your computer and use it in GitHub Desktop.
Method for returning IE version based on UA string
function getIEVersion() {
var ua = window.navigator.userAgent,
msie = ua.indexOf("MSIE "),
version = false;
if (msie > 0) {
// If Internet Explorer, return version number
version = (parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))));
}
return version;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment