Skip to content

Instantly share code, notes, and snippets.

@bennyzhao
Created September 10, 2013 09:41
Show Gist options
  • Save bennyzhao/6507174 to your computer and use it in GitHub Desktop.
Save bennyzhao/6507174 to your computer and use it in GitHub Desktop.
//IE VERSION CONTROL
function getInternetExplorerVersion() {
// Return value assumes failure.
var rv = -1;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
}
return rv;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment