• JS判断客户端是否是iOS或者Android


    http://www.cnblogs.com/zyjzz/p/4996926.html

    参考:http://caibaojian.com/browser-ios-or-android.html

    function is_weixin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            return true;
        } else {
            return false;
        }
    }
    

      

    JS判断手机操作系统(ios或android)并跳转到不同下载页面

    参考:http://www.bcty365.com/content-69-1807-1.html

     $(function () {
        var u = navigator.userAgent, app = navigator.appVersion;
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
        var isIOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
        if (isAndroid) {
            window.location.href = 'appDownload.html';
        }
        if (isIOS) {
            window.location.href = 'iosDownload.html';
        }
    });
    

      

    js判断是否电脑端

    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;
    }
    

      

  • 相关阅读:
    hnust Snowman
    hnust 可口可乐大促销
    hnust 聚宝盆
    hnust 搬书
    hnust 神奇的序列
    hnust 懒人多动脑
    hnust CZJ-Superman
    集合Set--BST实现
    快速排序
    位运算符
  • 原文地址:https://www.cnblogs.com/itfantasy/p/7200524.html
Copyright © 2020-2023  润新知