Cocos Creator (JavaScript手机类型判断)

 

手机类型判断

1 var BrowserInfo = {
2     userAgent: navigator.userAgent.toLowerCase()
3     isAndroid: Boolean(navigator.userAgent.match(/android/ig)),
4     isIphone: Boolean(navigator.userAgent.match(/iphone|ipod/ig)),
5     isIpad: Boolean(navigator.userAgent.match(/ipad/ig)),
6     isWeixin: Boolean(navigator.userAgent.match(/MicroMessenger/ig)),
7 }

 

Cocos Creator (JavaScript手机类型判断)

上一篇:箭头函数表达式和声名式函数表达式的区别以及 Function.prototype的bind, apply,call方法


下一篇:Vue2.0 axios 读取本地json文件