
正文
jquery判断ie,jquery判断某个类是否存在的方法
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
jquery 判断是否ie8?
jquery10中$.browser方法已经废弃了\x0d\x0a\x0d\x0ajquery现在只能检测浏览器是否支持某特性, 业界也推荐这么做\x0d\x0a\x0d\x0ahtml5的新特性ie8以下不支持, 所以可以用下面的方法进行判断\x0d\x0a\x0d\x0a$.support.leadingWhitespace 如果是false, 就是ie8及以下, 如果是true, 就是新的浏览器, 包括firefox, chrome, ie9以上
相关问答
Q1: 使用jquery3.1.1版本,如何判断浏览器为ie8浏览器
script type="text/javascript"
if(navigator.appName ==
"Microsoft Internet Explorer" navigator.appVersion
.split(";")[1].replace(/[ ]/g,"")=="MSIE6.0")
{
alert("IE 6.0");
}
else
if(navigator.appName == "Microsoft Internet Explorer"
navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE7.0")
{
alert("IE 7.0");
}
else
if(navigator.appName == "Microsoft Internet Explorer"
navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE8.0")
{
alert("IE 8.0");
}
else
if(navigator.appName == "Microsoft Internet Explorer"
navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE9.0")
{
alert("IE 9.0");
}
/script
Q2: jquery不兼容低版本ie浏览器怎么解决办法
jQuery新版本已经不再进行IE低版本(IE6、IE7、IE8)的兼容性处理。
如果项目需要兼容IE低版本,需要使用jQuery1.x版本,从2.x开始已经不兼容IE6、7、8了。
以下为jQuery官网的通知:
jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8. All the notes in the jQuery 1.9 Upgrade Guide apply here as well. Since IE 8 is still relatively common, we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site. Please read the 2.0 release notes carefully.
翻译如下:
jQuery 2.x和jQuery的API用法相同,但是不再支持IE6、7、8。
1.9版本中的所有升级向导信息同样适用于2.x
由于IE8仍然用户较多,因此建议使用1.x版本,除非确定没有用IE6、7、8的用户访问网站。
请仔细阅读2.0的发布信息。







