js判断客服端

 ua: function () {
                    return navigator.userAgent.toLowerCase()
                },
                isMobile: function () {
                    return M.ua().match(/iPhone|iPad|iPod|Android|IEMobile/i)
                },
                isAndroid: function () {
                    return -1 != M.ua().indexOf("android") ? 1 : 0
                },
                isIOS: function () {
                    var a = M.ua();
                    return -1 != a.indexOf("iphone") || -1 != a.indexOf("ipad") || -1 != a.indexOf("ipod") ? 1 : 0
                },
                platform: function () {
                    return M.isMobile() ? M.isIOS() ? "IOS" : M.isAndroid() ? "Android" : "other-mobile" : "PC"
                },
                isWeixin: function () {
                    return -1 != M.ua().indexOf("micromessenger") ? 1 : 0
                },
                isWeixinPay: function () {
                    if (M.isWeixin()) {
                        var a = M.ua(),
                        b = a.substr(a.indexOf("micromessenger"), 18).split("/");
                        return Number(b[1]) >= 5 ? 1 : 0
                    }
                    return 0
                },

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。