js判断pc或者h5, h5判断ios和android
js判断环境
·
pc和h5
const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop";
// Example
detectDeviceType(); // "Mobile" or "Desktop"
ios和android
if (/iP(hone|od|ad)/.test(window.navigator.userAgent)) {
}
更多推荐
已为社区贡献2条内容
所有评论(0)