Skip to content

Instantly share code, notes, and snippets.

@mir4a
Last active March 20, 2016 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mir4a/5211477 to your computer and use it in GitHub Desktop.
Save mir4a/5211477 to your computer and use it in GitHub Desktop.
Check IE version
//<editor-fold desc="Проверка версии IE">
function getInternetExplorerVersion()
{
var rv = -1; // Return value assumes failure.
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;
}
function checkVersion()
{
var ver = getInternetExplorerVersion();
return ver;
}
//</editor-fold>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment