Andrews and IOS, a common micro-channel two-dimensional code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
</head>
<body>

  <script>

  /**
    Out of such links is probably long
    http://xxxx.cn/243423.html?c=Q23DR32
  */

  // c = Q23DR32 invitation code is scanned to obtain registration. 
  // this parameter added to the back of the parameters are automatically ignored and will not affect loading this page

    Godownlod ();

    // to download 
    function goDownload () {
       var U = the navigator.userAgent, App = of navigator.appVersion;
       var isAndroid = u.indexOf ( ' the Android ' ) >  - . 1  || u.indexOf ( ' the Linux ' ) >  - . 1 ;
       var isIOS =  !! u.match ( / \ (I [^;] +; (the U-;?) the CPU the Mac the OS X-+. / );
       // Andrews browser 
      IF (isAndroid) {
        window.location.href =  ' http://xxxxxxx.cn/release/xxxx-release.apk ' ; // jump Andrews end Download 
      }
       // is iOS browser 
      IF (isIOS) {
        window.location.href =  ' https://itunes.apple.com/cn/app/xxxxxxx/id1124348115?mt=8 ' ; // jump AppStore Download 
      }

      // internal micro channel the webView 
      IF (is_weixn ()) {
        Alert ( " Click on the top right button, click the Use browser to open " );
      }

      // the PC side 
      IF (Ispc ()) {
        window.location.href =  ' http://www.xxxxxxx.cn/index.html ' ; // homepage 
      }
    }

    // 是微信浏览器
    function is_weixn(){
      var ua = navigator.userAgent.toLowerCase();
      if(ua.match(/MicroMessenger/i)=="micromessenger") {
        return true;
      } else {
        return false;
      }
    }


    function IsPC() {
      var userAgentInfo = navigator.userAgent;
      var Agents = ["Android", "iPhone",
        "SymbianOS", "Windows Phone",
        "iPad", "iPod"];
      var flag = true;
      for (var v = 0; v < Agents.length;v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
          flag = false;
          break;
        }
      }
      return flag;
    }

  </script>
</body>
</html>

Put on the server obtains links on this page to generate two-dimensional code

Guess you like

Origin www.cnblogs.com/tommymarc/p/11627349.html