如何檢測IE11?當(dāng)我要檢測IE時,我使用以下代碼:function getInternetExplorerVersion()
{
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;
}
function checkVersion()
{
var msg = "You're not using Internet Explorer.";
var ver = getInternetExplorerVersion();
if ( ver > -1 )
{
msg = "You are using IE " + ver;
}
alert( msg );
}但是IE 11正在返回“您沒有使用InternetExplorer”。我怎么能發(fā)現(xiàn)它?
如何檢測IE11?
慕容708150
2019-07-12 18:51:13