判断手机类型

var type="";
if (/android/i.test(navigator.userAgent)){
type="android";
}
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
type="ios";
}

posted @ 2022-11-24 16:46  漫步火星  阅读(5)  评论(0编辑  收藏  举报