
正文
jquery判断ie,jquery判断ie浏览器
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
使用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
相关问答
Q1: 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以上
Q2: js 或jquery 怎么在IE7 下判断当前浏览器版本是否为IE7
可以用
$.browser.msie
--在 Microsoft's Internet Explorer 浏览器中返回 true。
$.browser.version
--IE测试返回7.0
具体的你可以写个页面alert出来测试一下.
Q3: 请问用jQuery怎么判断浏览器的版本 然后加载别的css
jquery判断浏览器是否是ie6
if($.browser.msie($.browser.version == "6.0")!$.support.style){ //IE6
//加载另外的css
}






