识别浏览器的方法
来源:互联网 发布:剑灵邀请一直网络忙 编辑:程序博客网 时间:2024/05/16 14:34
注意顺序:
/* 得到浏览器的类型 */ function getExplore() { var userAgent = navigator.userAgent; if (userAgent.indexOf("Opera") > -1 || userAgent.indexOf("OPR") > -1) { return 'Opera'; } else if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1) { return 'IE'; } else if (userAgent.indexOf("Edge") > -1) { return 'Edge'; } else if (userAgent.indexOf("Firefox") > -1) { return 'Firefox'; } else if (userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1) { return 'Safari'; } else if (userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1) { return 'Chrome'; } else if (!!window.ActiveXObject || "ActiveXObject" in window) { return 'IE11'; } else { return 'Unkonwn'; }}
阅读全文
0 0
- 识别浏览器的方法
- 识别浏览器的JavaScript引擎的方法
- 浏览器的JavaScript引擎的识别方法
- 识别浏览器版本是IE6,IE7,IE8的方法
- 解决浏览器无法正确识别网页编码的方法
- 识别你的浏览器。
- 浏览器的userAgent识别
- 基于图像识别测试手机浏览器打开网页首屏时间的方法
- 电阻的识别方法
- 贴片磁珠的识别方法
- 端口的识别方法
- 风险识别的方法
- 识别汉字的方法
- ie浏览器前缀特殊符号的识别
- 浏览器兼容的方法
- 判断浏览器的方法
- 语音识别的基本方法
- 识别用例的方法
- The RT Patch---what needs to be done to get it into Mainline ---Steven Rostedt
- 汉诺塔
- C++中static、const、static const修饰变量作用详解
- 文章标题
- Logstash插件filter介绍及ELK相关预警配置
- 识别浏览器的方法
- POJ.1321 棋盘问题 (DFS)
- 第五章 神经网络
- 王小二切饼
- pageEncoding和charset 编码 以及<%@ page contentType="text/html; charset=utf-8"....>作用
- attention 机制入门
- 以开始、中间、最后为基准的递归快排实现
- BZOJ 2442 [Usaco2011 Open]修剪草坪 DP+单调队列优化
- UVA 10815 (字符串处理)