[关闭]
@StrGlee 2018-08-08T14:22:19.000000Z 字数 780 阅读 733

ua


在此输入正文

  1. <head>
  2. <meta charset=utf-8 />
  3. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  4. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  5. <title>军职在线</title>
  6. </head>
  7. <script>
  8. var userAgent = navigator.userAgent;
  9. var _isAndroid = !!userAgent.match(/android/ig);
  10. var _isIos = !!userAgent.match(/iphone|ipad|ipod/ig);
  11. var _isIpad = !!userAgent.match(/ipad/ig);
  12. var _isIDevicePhone = (/iphone|ipod/gi).test(navigator.platform);
  13. var _isIDeviceIpad = !_isIDevicePhone && (/ipad/gi).test(navigator.platform);
  14. var _isIDevice = _isIDevicePhone || _isIDeviceIpad;
  15. var _isWeixin = !!userAgent.match(/micromessenger/ig)
  16. var _isMiniProgram == _isAndroid && _isWeixin && !!userAgent.match(/miniprogram/ig)
  17. if(_isIos || _isAndroid || _isIDevice || _isWeixin || _isMiniProgram){
  18. // 移动端
  19. }
  20. </script>
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注