test{
isIE: function(){ return !+"\v1"; },
isFF: function(){ return !!_V_.ua.match("Firefox") },
isIPad: function(){ return navigator.userAgent.match(/iPad/i) !== null; },
isIPhone: function(){ return navigator.userAgent.match(/iPhone/i) !== null; },
isIOS: function(){ return VideoJS.isIPhone() || VideoJS.isIPad(); },
iOSVersion: function() {
var match = navigator.userAgent.match(/OS (\d+)_/i);
if (match && match[1]) { return match[1]; }
},
isAndroid: function(){ return navigator.userAgent.match(/Android.*AppleWebKit/i) !== null; },
androidVersion: function() {
var match = navigator.userAgent.match(/Android (\d+)\./i);
if (match && match[1]) { return match[1]; }
}
}js 检测浏览器版本
最新推荐文章于 2025-12-15 15:15:21 发布
本文介绍了一种检测用户浏览器类型及版本的方法,包括IE、Firefox、iPad、iPhone、iOS、Android等主流浏览器及其版本信息。通过简单的JavaScript代码实现跨平台设备识别。
2430

被折叠的 条评论
为什么被折叠?



