h5判断设备是ios还是android

var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
posted @ 2019-07-22 16:42  WXUECHAO  阅读(1696)  评论(0编辑  收藏  举报