php中文网 | cnphp.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 537|回复: 0

Browser Detection

[复制链接]

2661

主题

2668

帖子

9460

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
1
威望
0
积分
6677
贡献
0
注册时间
2021-4-14
最后登录
2024-5-9
在线时间
672 小时
QQ
发表于 2022-3-24 12:22:52 | 显示全部楼层 |阅读模式
// Browser detection

// Internet Explorer
var ie  = document.all != null;  //ie4 and above
var ie5 = document.getElementById && document.all;
var ie6 = document.getElementById && document.all&&(navigator.appVersion.indexOf("MSIE 6.")>=0);

// Netscape
var ns4 = document.layers != null;
var ns6 = document.getElementById && !document.all;
var ns  = ns4 || ns6;

// Firefox
var ff  = !document.layers && !document.all;

// Opera
var op  = navigator.userAgent.indexOf("opera")>0;
var op7 = op && operaVersion() <= 7;
var op8 = op && operaVersion() >= 8;

// Detects the Opera version
function operaVersion() {
        agent = navigator.userAgent;
        idx = agent.indexOf("opera");       
        if (idx>-1) {
                return parseInt(agent.subString(idx+6,idx+7));
        }
}
Browser Detection.txt (774 Bytes, 下载次数: 0)





上一篇:Dead Centre a DIV
下一篇:SocketCoder语音_视频会议模块源码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|php中文网 | cnphp.com ( 赣ICP备2021002321号-2 )

GMT+8, 2024-5-10 13:48 , Processed in 0.186207 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

申明:本站所有资源皆搜集自网络,相关版权归版权持有人所有,如有侵权,请电邮(fiorkn@foxmail.com)告之,本站会尽快删除。

快速回复 返回顶部 返回列表