判断浏览器的内核及版本号方法汇总_jquery

js教程评论535 views阅读模式

通过jquery 判断浏览器的内核及版本号

复制代码 代码如下:




通过浏览器版本信息判断各浏览器

复制代码 代码如下:

var _uat=navigator.userAgent;

if(_uat.indexOf("MSIE 6.0")>0) alert("ie6");

else if(_uat.indexOf("MSIE 7.0")>0) alert("ie7");

else if(_uat.indexOf("MSIE 8.0")>0) alert("ie8");

else if(_uat.indexOf("Firefox")>0) alert("firefox");

CSS判断浏览器

复制代码 代码如下:

#example{color:red ;} /*firefox*/

* html #example{color:blue;} /*ie6*/

*+html #example{color:green;} /*ie7*/

HTML判断浏览器

复制代码 代码如下:

1.
除IE外都可识别


2.


3.


4.


5.


6.


7.


8.


企鹅博客
  • 本文由 发表于 2020年8月2日 22:02:11
  • 转载请务必保留本文链接:https://www.qieseo.com/415793.html

发表评论