javascript - how to detect android smartphone and tablet individually -
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 above methods, can detect iphone, ipad , ipod individually. how can detect android smartphone , tablet individually?
Comments
Post a Comment