0

Javascript 判断 Android iOS

terry created at5 years ago view count: 2484

Webview 里面的HTML5页面通过Javascript 判断 Android 还是 iOS 访问。

report
回复
0
var isMobile = {
        Android: function() {
            return navigator.userAgent.match(/Android/i);
        },

        iOS: function() {
            return navigator.userAgent.match(/iPhone|iPad|iPod/i);
        },
        any: function() {
            return (isMobile.Android()  || isMobile.iOS());
        }

    };
5 years ago 回复

Recent search keywords