通过js较精确识别不同浏览器
来源:互联网 发布:通讯软件有哪些 编辑:程序博客网 时间:2024/04/27 18:05
function onloade() {
if(window.ActiveXObject){
//判断是否是IE 7 以上
if(document.documentElement && typeof document.documentElement.style.maxHeight!="undefined" ){
//判断是否是IE8
if(typeof document.adoptNode!="undefined"){
//return "IE 8"
alert("IE 8");
}
//return "IE 7";
alert("IE 7");
}
//opera独占
}else if (typeof window.opera!="undefined"){
//return "opera";
alert("opera");
}
//Mozilla独占
else if(typeof window.netscape !="undefined"){
if(typeof window.Iterator !="undefined"){
if(typeof document.styleSheetSet !="undefined"){
//firefox 3
//return "firfox 3";
alert("firfox 3");
}
}
//return "mozilla";
}
else if(typeof window.pageXOffset !="undefined"){
try {
if(typeof external.AddSearchProvider !="undefined"){
//return "chome";
alert("chome");
}
} catch (e) {
// TODO: handle exception
//return "safari"
alert("safari");
}
}else {
//return "unknown";
alert("unknown");
}
}
if(window.ActiveXObject){
//判断是否是IE 7 以上
if(document.documentElement && typeof document.documentElement.style.maxHeight!="undefined" ){
//判断是否是IE8
if(typeof document.adoptNode!="undefined"){
//return "IE 8"
alert("IE 8");
}
//return "IE 7";
alert("IE 7");
}
//opera独占
}else if (typeof window.opera!="undefined"){
//return "opera";
alert("opera");
}
//Mozilla独占
else if(typeof window.netscape !="undefined"){
if(typeof window.Iterator !="undefined"){
if(typeof document.styleSheetSet !="undefined"){
//firefox 3
//return "firfox 3";
alert("firfox 3");
}
}
//return "mozilla";
}
else if(typeof window.pageXOffset !="undefined"){
try {
if(typeof external.AddSearchProvider !="undefined"){
//return "chome";
alert("chome");
}
} catch (e) {
// TODO: handle exception
//return "safari"
alert("safari");
}
}else {
//return "unknown";
alert("unknown");
}
}
0 0
- 通过js较精确识别不同浏览器
- js识别不同浏览器
- JS识别不同浏览器
- JS识别不同浏览器信息
- js识别浏览器
- JS识别浏览器类型
- js识别360浏览器
- 不同浏览器引用不同JS
- js区分不同浏览器
- js判断不同浏览器
- 通过创建方法,减少不同浏览器通过JS设置样式时的重复书写
- JS识别IE不同版本
- js识别浏览器 选择CSS
- JS识别各大浏览器
- js 中加减乘除 比较精确的算法,js本身有些运算会出错,这里给出较精确的算法
- 通过input上传图片,判断不同浏览器及图片类型和大小的js代码
- js 不同浏览器 的判断
- javascript通过navigator.userAgent识别各种浏览器
- Magento2 create a new module
- 如何修改Blobs Storage Size的最小值以及如何验证Blob已经被存储到自定义的Blob Store里
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into
- Swift回调及notifition消息机制
- 喜!人民币入篮;忧!欧央行下调。【济南中金点评 www.zjzx01.com】
- 通过js较精确识别不同浏览器
- IOS多线程编程
- C_1:linux系统基础
- 向日葵和您把话一谈!
- DB2中导出数据库的所有DDL脚本
- 简单的开始,努力的前行。
- tftp命令使用说明
- IOS的xcode7的不需要开发者账号的调试步骤
- Java读书笔记十六(Java中的枚举类)