Home > Web Front-end > JS Tutorial > body text

Summary of methods to determine browser kernel and version number_jquery

WBOY
Release: 2016-05-16 16:21:58
Original
1269 people have browsed it

Use jquery to determine the browser’s kernel and version number

Copy code The code is as follows:


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

复制代码 代码如下:

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.
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!