Javascript 如何检测小于10的msie?

Javascript 如何检测小于10的msie?,javascript,jquery,Javascript,Jquery,可能有很多问题和答案,但我找不到最好、最快、最简单的方法来检测低于10的internet explorer版本 那么,如何检测小于10的internet explorer呢?您可以在浏览器中测试用户代理字符串,但现在,这与检测web应用程序所需的特定功能相反,是不可取的。请查看这样的框架,它使您更轻松。如果你真的想检测IE,没有比下面列出的解决方案更快、更短的解决方案 var IElt10=0/*@cc_on@if(@_jscript_version<10)1@end@*/; 现在,将警

可能有很多问题和答案,但我找不到最好、最快、最简单的方法来检测低于10的internet explorer版本


那么,如何检测小于10的internet explorer呢?

您可以在浏览器中测试用户代理字符串,但现在,这与检测web应用程序所需的特定功能相反,是不可取的。请查看这样的框架,它使您更轻松。如果你真的想检测IE,没有比下面列出的解决方案更快、更短的解决方案

var IElt10=0/*@cc_on@if(@_jscript_version<10)1@end@*/;

现在,将
警报(0)
替换为
0/@cc_on@if(@_jscript_version请参见:您没有;相反,您可以检测您可以使用或不使用哪些浏览器功能。@kamilkp我只需要js解决方案,但您提供的答案也是html。您应该检测浏览器功能。您可以像这样使用库:
userAgent
容易受到用户的欺骗或浏览器的误报呃,它本身只检测9,但我需要的不到10。你知道你可以解析int(value)<10吗
var IElt10=0/*@cc_on@if(@_jscript_version<10)1@end@*/;
if (IElt10){
    alert("You are using a version of internet explorer less than 10");
} else {
    alert("You're not using a version of internet explorer less than 10");
}
var IElt10=alert(0/*@cc_on@if(@_jscript_version<10)1@end@*/);
if (IElt10){
    alert("You are using a version of internet explorer less than 10");
} else {
    alert("You're not using a version of internet explorer less than 10");
}
alert(0)?alert("You are using a version of internet explorer less than 10"):alert("You're not using a version of internet explorer less than 10")
0/*@cc_on@if(@_jscript_version<10)1@end@*/?alert("You are using a version of internet explorer less than 10"):alert("You're not using a version of internet explorer less than 10")