//判断是安卓还是IOS alert(ismobile(1)) 1表示Android,0表示ios function ismobile(test){ var u = navigator.userAgent, app = navigator.appVersion; if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ if(window.location.href.indexOf("?mobile") < 0){ try{ if(/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)){ return '0'; }else{ return '1'; } }catch(e){} } }else if( u.indexOf('iPad') > -1){ return '0'; }else{ return '1'; }}
function reAccount(){ if(ismobile(1)==1){ //Android window.android.reAccount(); }else{ //ios reAccount(); } }
jquery 判断移动端是安卓系统还是ios系统
最新推荐文章于 2024-08-17 04:07:11 发布