通过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.