Skip to content

Instantly share code, notes, and snippets.

@jwatney
Created July 31, 2020 16:20
Show Gist options
  • Save jwatney/ab2a6e104945d38ac1abf307dcda2a9c to your computer and use it in GitHub Desktop.
Save jwatney/ab2a6e104945d38ac1abf307dcda2a9c to your computer and use it in GitHub Desktop.
Determines if the browser is IE and which version.
var Browser = (function() {
'use strict';
var version = -1;
var isIE = false;
var map = {
'5.6': 6,
'5.7': 7,
'5.8': 8,
'9': 9,
'10': 10,
'11': 11
};
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')();
if(jscriptVersion !== undefined || !!window.msCrypto) {
isIE = true;
version = map[jscriptVersion || '11'];
}
return {
isIE: isIE,
version: version
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment