判断浏览器版本
来源:互联网 发布:软件开发项目 英文 编辑:程序博客网 时间:2024/05/16 03:42
出自:http://www.cnblogs.com/leadzen/archive/2008/09/06/1285764.html
<script type="text/javascript">
var Sys = {};var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)
Sys.ie = ua.match(/msie ([\d.]+)/)[1]
else if (document.getBoxObjectFor)
Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1]
else if (window.MessageEvent && !document.getBoxObjectFor)
Sys.chrome = ua.match(/chrome\/([\d.]+)/)[1]
else if (window.opera)
Sys.opera = ua.match(/opera.([\d.]+)/)[1]
else if (window.openDatabase)
Sys.safari = ua.match(/version\/([\d.]+)/)[1];
//以下进行测试
if(Sys.ie) document.write('IE: '+Sys.ie);
if(Sys.firefox) document.write('Firefox: '+Sys.firefox);
if(Sys.chrome) document.write('Chrome: '+Sys.chrome);
if(Sys.opera) document.write('Opera: '+Sys.opera);
if(Sys.safari) document.write('Safari: '+Sys.safari);
</script>
<script type="text/javascript">
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
window.ActiveXObject ? Sys.ie = ua.match(/msie ([\d.]+)/)[1] :
document.getBoxObjectFor ? Sys.firefox = ua.match(/firefox\/([\d.]+)/)[1] :
window.MessageEvent && !document.getBoxObjectFor ? Sys.chrome = ua.match(/chrome\/([\d.]+)/)[1] :
window.opera ? Sys.opera = ua.match(/opera.([\d.]+)/)[1] :
window.openDatabase ? Sys.safari = ua.match(/version\/([\d.]+)/)[1] : 0;
//以下进行测试
if(Sys.ie) document.write('IE: '+Sys.ie);
if(Sys.firefox) document.write('Firefox: '+Sys.firefox);
if(Sys.chrome) document.write('Chrome: '+Sys.chrome);
if(Sys.opera) document.write('Opera: '+Sys.opera);
if(Sys.safari) document.write('Safari: '+Sys.safari);
</script>
- 判断浏览器版本
- 判断浏览器的版本
- js判断浏览器版本
- 判断浏览器版本
- 如何判断浏览器版本
- js判断浏览器版本
- js判断浏览器版本
- 判断浏览器版本
- IE 浏览器版本判断
- html判断浏览器版本
- jQuery浏览器版本判断
- JavaScript判断浏览器版本
- 判断浏览器版本
- javascript 判断浏览器版本
- 判断浏览器版本
- 判断IE浏览器版本
- javascript判断浏览器版本
- 判断浏览器版本
- IR Remote Control Theory
- PE格式全分析
- linux操作系统二 进程管理
- ioctl (未完成)
- mysql常用经典操作
- 判断浏览器版本
- JDBC主要知识点总结
- java.sql.SQLException: ORA-03115: 不支持的网络数据类型或表示法
- javascript创建二维码(Table/Canvas两种方式)
- ProcessXP and ProcessMonitor
- SQLite介绍及使用场景
- 如何查看ubuntu操作系统位数
- javascript window.open() 用法
- 常用端口号对照表