somascope
3/2/2019 - 9:28 PM

Detect IE version

function ieVersion(uaString) {
  // Returns IE version number, or undefined
  uaString = uaString || navigator.userAgent;
  var match = /\b(MSIE |Trident.*?rv:|Edge\/)(\d+)/.exec(uaString);
  if (match) return parseInt(match[2])
}