mobileDetect.js

/**
 * MobileDetect.system          ios || android
 */
var MobileDetect = {
    init: function() {
        this.system = this.info();
    },
    info: function() {
        return function() {
            var u = navigator.userAgent;
            if (u.match(/(iPad|iPhone)/i)) {
                return 'ios';
            }
            if (u.match(/(Android)/i)) {
                return 'android';
            }
        } ();
    }
};
MobileDetect.init();

 

posted @ 2016-06-07 16:11  koala_熊  Views(671)  Comments(0Edit  收藏  举报