直接判断系统是android系统还是ios系统,这对移动web开发会有帮助的
_YTG_IOSorANDROID = {
systemJudge: function(){
var systemFlag = "";
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if(isAndroid){
systemFlag = 'Android';
}else if(isiOS){
systemFlag = 'IOS';
}
return systemFlag;
}
}