function myexplorer(){
var explorer = window.navigator.userAgent;
if (!!window.ActiveXObject || "ActiveXObject" in window){//IE
if (!window.XMLHttpRequest){
return myexplorer="IE"; //IE6
}else if (window.XMLHttpRequest && !document.documentMode){
return myexplorer="IE"; //IE7
}else if (!-[1,] && document.documentMode && !("msDoNotTrack" in window.navigator)){
return myexplorer="IE"; //IE8
}else{//IE9 10 11
var hasStrictMode=(function(){
"use strict";
return this===undefined;
}());
if (hasStrictMode){
if (!!window.attachEvent){
return myexplorer="IE"; //IE10
}else{
return myexplorer="IE"; //IE11
}
}else{
return myexplorer="IE"; //IE9
}
}
}else{//非IE
//application/vnd.chromium.remoting-viewer 可能为360特有
var is360 = _mime("type", "application/vnd.chromium.remoting-viewer"); if (isChrome() && is360) {
return myexplorer= "360";
}else{
return myexplorer= "other"; //其他浏览器
}
}
} var browser = myexplorer();
if(browser == "IE" || browser == "360"){
get_video_list();
}else{
alert("其他");
} //检测是否是谷歌内核(可排除360及谷歌以外的浏览器)
function isChrome(){
var ua = navigator.userAgent.toLowerCase(); return ua.indexOf("chrome") > 1;
}
//测试mime
function _mime(option, value) {
var mimeTypes = navigator.mimeTypes;
if(mimeTypes){
for (var mt in mimeTypes) {
if (mimeTypes[mt][option] == value) {
return true;
}
}
return false;
}
} 方法二

$.browser = function () {
    var userAgent = navigator.userAgent;
    var isOpera = userAgent.indexOf("Opera") > -1;
    if (isOpera) {
       return "Opera"
    };
    if (userAgent.indexOf("Firefox") > -1) {
      return "Firefox";
    }
   if (userAgent.indexOf("Chrome") > -1) {
       if (window.navigator.webkitPersistentStorage.toString().indexOf('DeprecatedStorageQuota') > -1) {
           return "Chrome";
        } else {
             return "360";
       }
    }
    if (userAgent.indexOf("Safari") > -1) {
      return "Safari";
    }
      if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
          return "IE";
     };
}

最新文章

  1. div悬浮
  2. MyBatis学习总结(四)——解决字段名与实体类属性名不相同的冲突(转载)
  3. 纯jsp用户登录系统
  4. C# 创建Windows Service
  5. sql语句原则
  6. [转]UDP/TCP穿越NAT的P2P通信方法研究(UDP/TCP打洞 Hole Punching)
  7. UVA 11181 dfs 概率
  8. OC - 29.自定义布局实现瀑布流
  9. [BZOJ 3747] [POI 2015] Kinoman【线段树】
  10. Java知识点复习
  11. this笔记
  12. 0_Simple__simpleAtomicIntrinsics + 0_Simple__simpleAtomicIntrinsics_nvrtc
  13. 2017C语言程序设计预备作业
  14. Docker学习(1)安装
  15. 从git中删除 .idea 目录
  16. MVC 之 缓存机制(一)
  17. 设计模式之单一职责原则(iOS开发,代码用Objective-C展示)
  18. Chrome V8引擎的一点认识
  19. selenium 基本常用操作
  20. cocos2dx 3.2 解决输入框(TextField,TextFieldTTF) 中文乱码问题

热门文章

  1. Tensorflow卷积接口总结
  2. Ubuntu midi 播放
  3. 洛谷 P3621 [APIO2007]风铃【贪心】
  4. 比特币搬砖对冲策略Python源码
  5. php安装的扩展php -m可以看到,但是phpinfo()看不到,php-fpm关闭了重新打开还是不行?
  6. 进击的Python【第十三章】:Web前端基础之HTML与CSS样式
  7. Ubuntu Server 上安装pip后pip命令报错的解决办法
  8. C# DataTable的详细用法[转]
  9. gcc 编译 c++ 程序(转载)
  10. [转]C#委托Action、Action<T>、Func<T>、Predicate<T>