![](/img/trans.png)
[英]Is it possible to detect all versions of IE with Javascript? How?
[英]How to detect IE “Update Versions”
在IE更新到更新版本11.0.35之后,在内容可编辑块中编辑韩文时,“ keydown”事件和DOM突变的时间发生了变化。
如何检测Javascript中的IE更新版本?
(IE ScriptEngineMajor / Minor / BuildVersion函数没有用,因为即使在相同的“更新版本”的情况下它也有所不同)
function getInternetExplorerVersion()
// Returns the version of Windows Internet Explorer or a -1
// (indicating the use of another browser).
{
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 checkIEVersion() {
var msg = "You're not using Windows Internet Explorer.";
var ver = getInternetExplorerVersion();
if (ver > -1) {
console.log(ver);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.