js判断Android和Ios
16lz
2021-12-04
Android&IOS
&&&&&&&&&&&&&&&&&&&&&&&&
// 判断安卓
function isAndroid() {
var u = navigator.userAgent;
if (u.indexOf("Android") > -1 || u.indexOf("Linux") > -1) {
if (window.ShowFitness !== undefined) return true;
}
return false;
}
// 判断设备为 ios
function isIos() {
var u = navigator.userAgent;
if (u.indexOf("iPhone") > -1 || u.indexOf("iOS") > -1) {
return true;
}
return false;
}
更多相关文章
- library project 和android项目
- Android(安卓)笔记
- Linux/Android——input系统之 kernel层 与 frameworks层交互 (
- adb shell 命令详解
- 【Android】联通性 -- USB从属模式
- android in linux 笔记
- android ADB 详解
- Androidmanifest.xml里的
- Android(安卓)提供的一系列辅助系统开发工具