浏览器判断
来源:互联网 发布:淘宝代购是什么意思 编辑:程序博客网 时间:2024/05/21 03:26
<!--[if IE]> 所有的IE可识别 <![endif]-->
<!--[if IE 6]> 仅IE6可识别 <![endif]-->
<!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]-->
<!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
<!--[if IE 7]> 仅IE7可识别 <![endif]-->
<!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]-->
<!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]-->
<!--[if IE 8]> 仅IE8可识别 <![endif]-->
<!--[if IE 9]> 仅IE9可识别 <![endif]-->
if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/6./i)=="6."){
alert("IE 6");
}
if(navigator.appName=="Microsoft Internet Explorer"&& navigator.appVersion.Math(/6./i)=="6."){
}
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i)=="7."){
alert("IE 7");
}
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){
alert("IE 8");
}
else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9."){
alert("IE 9");
}else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/10./i)=="10."){
alert("IE 10");
} else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/11./i)=="11."){
alert("IE 11");
} if(navigator.userAgent.indexOf("Opera") != -1) {
alert('Opera');
}
else if(navigator.userAgent.indexOf("MSIE") != -1) {
alert('Internet Explorer');
}
else if(navigator.userAgent.indexOf("Firefox") != -1) {
alert('Firefox');
}
else if(navigator.userAgent.indexOf("Netscape") != -1) {
alert('Netscape');
}
else if(navigator.userAgent.indexOf("Safari") != -1) {
alert('Safari');
}
else{
alert('无法识别的浏览器。');
}
- 判断浏览器
- 浏览器判断
- 判断浏览器
- 判断浏览器
- 浏览器判断
- 判断浏览器
- 判断浏览器
- 判断浏览器
- 浏览器判断
- 判断浏览器
- 判断浏览器
- 浏览器判断
- 浏览器判断
- 判断浏览器
- 浏览器判断
- 判断浏览器
- 判断浏览器
- 判断浏览器
- Java Collections工具类
- Windows update
- nginx limit_req限制ip在同一时间段的访问次数
- leetcode之two sum
- pom.xml中依赖接口及文件编译拷贝
- 浏览器判断
- 牛顿迭代法及最小二乘法
- ios中解析HTML
- [NOI 2015复习][BZOJ 1509][NOI 2003]逃学的小孩(树的直径)
- 网络爬虫(四) Java实现简单的网络爬虫
- Ubuntu下架设FTP服务器
- 每天一个linux命令(52):ifconfig命令
- VM linux虚拟机 和主机进行ftp连接
- Jmeter 参数化连接Mysql数据库