0
var isMobile = {
    Android: function() {
        return navigator.userAgent.match(/Android/i);
    },
    BlackBerry: function() {
        return navigator.userAgent.match(/BlackBerry/i);
    },
    iOS: function() {
        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    },
    Opera: function() {
        return navigator.userAgent.match(/Opera Mini/i);
    },
    Windows: function() {
        return navigator.userAgent.match(/IEMobile/i);
    },
    any: function() {
        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    }
};

With the above methods, we can detect iphone, ipad and ipod individually. But how can we detect android smartphone and tablet individually?

Ziem
  • 6,579
  • 8
  • 53
  • 86
  • Have you looked at this: http://stackoverflow.com/questions/5341637/how-do-detect-android-tablets-in-general-useragent – bytesized Apr 25 '15 at 10:48
  • http://stackoverflow.com/questions/7173642/detecting-whether-android-device-is-a-phone-or-a-tablet-with-javascript – mrak Apr 25 '15 at 13:03

0 Answers0