使用current-device.min.js判断设备操作系统是Andorid还是IOS。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="https://unpkg.com/current-device/umd/current-device.min.js"></script>
</head>
<body>
</body>
<script>
console.log(device.mobile());
console.log(device.ios())
console.log(device.android())
</script>
</html>
此js库体积非常小,只有1.7kb,在判断设备后会在html标签,添加对应信息,详见官方doc。
github地址:
https://github.com/matthewhudson/current-device
最后
以上就是可耐冷风最近收集整理的关于JS-判断设备操作系统是Andorid还是IOS的全部内容,更多相关JS-判断设备操作系统是Andorid还是IOS内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复