1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| * [checkPlatformm 检查客户端的平台] * @return {[string]} [客户端的类型名称] */ function checkPlatformm(){ var ua = window.navigator.userAgent.toLowerCase(); if(ua.match(/MicroMessenger/i) == 'micromessenger'){ return 'weixin'; }else if(ua.match(/android/i) == 'android'){ return 'android'; }else if(ua.match(/ios/i) == 'ios'){ return 'ios'; }else if(ua.match(/windows/i) == 'windows'){ return 'windows'; }else if(ua.match(/windows/i) == 'linux'){ return 'linux'; }else{ return 'unkown'; } }
|