javascript判断当前是安卓平台还是ios平台

if (/android/i.test(navigator.userAgent)){
    // todo : android
}
 
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
    // todo : ios
}

猜你喜欢

转载自bosschen.iteye.com/blog/2330388