if (/android/i.test(navigator.userAgent)){ // todo : android} if (/ipad|iphone|mac/i.test(navigator.userAgent)){ // todo : ios}
来源: http://www.phpxs.com/code/1007814/