以下内容摘自http://www.cnblogs.com/rubylouvre/archive/2009/10/14/1583362.html

//2010 4 16日更新
ie678 = !+"\v1" ;
ie678 = !-[1,];//IE9预览版中失效
ie678 ='\v'=='v' ;
ie678 = ('a~b'.split(/(~)/))[1] == "b"
ie678 = 0.9.toFixed(0) == "0"
IE8 = window.toStaticHTML
IE9 = window.msPerformance
ie = !!document.recalc
ie = !!window.VBArray
ie = !!window.ActiveXObject
ie678 = 0//@cc_on+1;
ie = !!window.createPopup;
ie = /*@cc_on!@*/!1;
ie = document.expando;//document.all在opera firefox的古老版本也存在
ie = /\w/.test('\u0130') //由群里的abcd友情提供

ie6 = !"1"[0] //利用IE6或IE5的字符串不能使用数组下标的特征
ie8 = !!window.XDomainRequest;
ie9 = document.documentMode && document.documentMode === 9;
//自创,基于条件编译的嗅探脚本,IE会返回其JS引擎的版本号,非IE返回0
var ieVersion = eval("''+/*@cc_on"+" @_jscript_version@*/-0")*1
ie9 = ieVersion === 5.9
ie8 = ieVersion === 5.8
ie7 = ieVersion === 5.7
ie6 = ieVersion === 5.6
ie5 = ieVersion === 5.5
//https://developer.mozilla.org/En/Windows_Media_in_Netscape
netscape = !!window.GeckoActiveXObject
gecko = !!window.netscape //包括firefox
firefox = !!window.Components
firefox = !!window.updateCommands
firefox = !!window.sidebar
safari = !!(navigator.vendor && navigator.vendor.match(/Apple/))
safari = window.openDatabase && !window.chrome;
chrome= !!(window.chrome && window.google)
opera=!!window.opera ;
//傲游2 3
maxthon = /maxthon/i.test(navigator.userAgent)
//360安全浏览器
is360se = /360se/i.test(navigator.userAgent)
//2010.6.4
setTimeout(function(){//FF的setTimeout总是有一个额余的参数0
var isFF = !!arguments.length;
alert(isFF)
}, 0);
//判定IE版本
2010.10.1
ie = (function(undefined){
var v = 3, div = document.createElement('div');
while (
div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->',
div.getElementsByTagName('i')[0]);
return v> 4 ? v : undefined;
}());
//判定IE版本 2011.2.24 IE 条件注释在
ie = (function() {
var v = 3, div = document.createElement('div');
while (div.innerHTML = '<!--[if gt IE '+(++v)+']>1<![endif]-->', div.innerHTML);
return v > 4 ? v : !v;
}());
//手机的相关判定 2011.9.21
isIPhone = /iPhone/i.test(navigator.userAgent);
isIPhone4 = window.devicePixelRatio >= 2
//在网页中,pixel与point比值称为device-pixel-ratio,普通设备都是1,iPhone 4是2,有些Android机型是1.5
//http://blog.webcreativepark.net/2011/01/25-173502.html
var ua = navigator.userAgent;
isAndroid = /Android/i.test(ua);
isBlackBerry = /BlackBerry/i.test(ua)
isWindowPhone = /IEMobile/i.test(ua)
isIOS = /iPhone|iPad|iPod/i.test(ua)
isMobile = isAndroid || isBlackBerry || isWindowPhone || isIOS

最新文章

  1. Spark On YARN使用时上传jar包过多导致磁盘空间不够。。。
  2. 转:sql之left join、right join、inner join的区别
  3. codeforces 732/D 二分
  4. Android各个版本 版本号对应关系表
  5. 黄聪:Discuz自制模板带jquery时与discuz本身冲突解决办法
  6. Extjs 4.2 grid 分页问题,点击下一页参数没带过去
  7. IIS 7.0、IIS 7.5 和 IIS 8.0 中的 HTTP 状态代码 转
  8. jQuery的touchstart,touchmove,touchend的获取位置
  9. 关于关注和取消关注的nodejs写法
  10. Python 操作 MySQL--(pymysql)
  11. Stack的相关API
  12. 无符号1byte转int
  13. MySQL高可用之组复制(4):详细分析组复制理论
  14. 如果redis没有设置expire,他是否默认永不过期?
  15. java笔记 -- 类与对象
  16. 使用Chrome开发者工具调试Android端内网页(微信,QQ,UC,App内嵌页等)
  17. 方便操作的命名范围scope
  18. ubuntu各类问题笔记
  19. 20145332卢鑫 WEB安全基础实验
  20. Scrapy-从数据库取出IP并判断是否可用

热门文章

  1. 多测试_linux_003_肖sir
  2. 【差分】POJ 3263 Tallest Cow
  3. redhat系统服务器重启后提示An error occurred during the file system check.
  4. centos8平台使用xfs文件系统
  5. centos8平台nginx服务配置打开文件限制max open files limits
  6. 1-1Java概述
  7. 在centOS上安装oracle出现java.lang.NoClassDefFoundError问题及解决方法
  8. mininet实践应用
  9. equals()方法和hashCode()方法详解
  10. UI自动化测试不稳定的因素