js判断浏览器

稿件来源: 互联网   撰稿作者: 匿名   发表日期: 2015-04-01   阅读次数: 149   查看权限: 游客查看

js判断浏览器

var ieVersion = /*@cc_on (function() {switch(@_jscript_version) {case 1.0: return 3; case 3.0: return 4; case 5.0: return 5; case 5.1: return 5; case 5.5: return 5.5; case 5.6: return 6; case 5.7: return 7; case 5.8: return 8; case 9: return 9; case 10: return 10;}})() || @*/ 0; //Internet Explorer 3-10
var ieVersion = (function() { if (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) { return parseFloat( RegExp.$1 ); } else { return false; } })(); //Internet Explorer ≤ 10
var isIE = !!window.ActiveXObject;//Internet Explorer 6-10
var isIE = document.all && document.compatMode; //Internet Explorer 6-10
var isIE = document.all && !document.querySelector; //Internet Explorer ≤ 7
var isIE = document.all && window.XMLHttpRequest && !document.querySelector;//Internet Explorer 7
var isIE = document.all && window.XMLHttpRequest; //Internet Explorer 7-10
var isIE = navigator.appVersion.indexOf("MSIE 7.") !== -1;//Internet Explorer 7
var isIE = !+'\v1'; //Internet Explorer ≤ 8
var isIE = '\v'=='v'; //Internet Explorer 8
var isIE = document.all && document.querySelector; //Internet Explorer 8-10
var isIE = document.all && !document.addEventListener; //Internet Explorer ≤ 8
var isIE = document.all && document.querySelector && !document.addEventListener; //Internet Explorer 8
var isIE = document.all && document.addEventListener; //Internet Explorer 9-10
var isIE = document.all && document.addEventListener && !window.atob; //Internet Explorer 9
var isIE = document.all && !window.atob; //Internet Explorer ≤ 9
var isIE = /*@cc_on!@*/false; //Internet Explorer ≤ 10
var isIE = document.all && window.atob; //Internet Explorer 10
var isIE = eval("/*@cc_on!@*/false") && document.documentMode === 10; //Internet Explorer 10
var isIE = document.body.style.msTouchAction !== undefined; //Internet Explorer ≥ 10
var isIE = window.navigator.msPointerEnabled; //Internet Explorer ≥ 10
var isIE = 'behavior' in document.documentElement.style && '-ms-user-select' in document.documentElement.style; //Internet Explorer 10
var isIE = '-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style; //Internet Explorer 11

var isWebkit = 'WebkitAppearance' in document.documentElement.style; // hrome * Safari ≥ 3 Opera ≥ 14
var isSafari = /constructor/i.test(window.HTMLElement); // Safari *
var isOperaMini = Object.prototype.toString.call(window.operamini) === '[object OperaMini]'; //Opera Mini *
var isOperaMini = (navigator.userAgent.indexOf('Opera Mini') > -1); //Opera Mini *
var isOpera = !!window.opera || /opera|opr/i.test(navigator.userAgent); //Opera *
var isFirefox = !!window.sidebar; //firefox *
var isFirefox = !!navigator.userAgent.match(/firefox/i); //firefox *
var isFirefox = 'MozAppearance' in document.documentElement.style; //firefox *
var isChromium = !!window.chrome; //Chrome * Opera ≥ 14 Android 4.0.4
var isChrome = !!window.chrome && !!window.chrome.webstore; //Chrome ≥ 14

 

关键词: javascript,判断浏览器   编辑时间: 2015-04-01 14:21:10

  • 感到高兴

    0

    高兴
  • 感到支持

    0

    支持
  • 感到搞笑

    0

    搞笑
  • 感到不解

    0

    不解
  • 感到谎言

    0

    谎言
  • 感到枪稿

    0

    枪稿
  • 感到震惊

    0

    震惊
  • 感到无奈

    0

    无奈
  • 感到无聊

    0

    无聊
  • 感到反对

    0

    反对
  • 感到愤怒

    0

    愤怒
0%(0)
0%(0)
上一篇:css3加载loading动画
下一篇:GIT教程
共有0 条评论 发言请遵守【相关规定

网友评论

会员头像
发 表同步腾讯微博    验证码:  点击更新请先登陆
  • 暂无评论
关闭模块文章图片 article Pictrue
  • 我的妈妈爸爸
  • 基于koa2+mysql+vue2.0+Element阳光内容管理系统
  • 代码覆盖率工具 Istanbul 入门教程
  • 全栈工程师的武器——MEAN
  • 9款超炫的 CSS3 复选框(Checkbox)
  • 微信开发在线翻译功能
  • CSS3那些不为人知的高级属性
  • 给easyui的datebox添加清空事件
  • flash写字效果
  • kendoUI系列教程之DropDownList下拉菜单
  • kendoUI系列教程之datetimepicker日期时间选择
  • kendoUI系列教程之datepicker日期选择
  • kendoUI系列教程之combobox下拉列表框
  • kendoUI系列教程之colorpicker
  • kendoUI系列教程之calendar日历表
  • kendoUI系列教程之autocomplete自动补齐