(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-5276656-4', 'mobileesp.com'); ga('send', 'pageview');

MobileESP API: JavaScript

Support for client-side JavaScript processing on phones is very poor to completely non-existent. Though much better on modern smartphones, JavaScript is still not quite at the desktop level. Generally speaking, JavaScript is probably reliable only for distinguishing between devices among modern smartphones and tablets. So if you want to know whether your visitor is one of these devices, the JavaScript probably works fine: iPhone, Android, Windows Phone, and BlackBerry 10+. A few other modern smartphone OSes such as Sailfish, Tizen, and Ubuntu are also expected to perform well.

As a result, we don’t recommend using the JavaScript for detecting any other device types. This list includes older BlackBerrys, old Windows Mobile (PocketPC and Smartphone), older Symbian, and practically all feature phones. Instead, usage of one of the server-side platforms (PHP, Java, ASP.NET) is recommended to detect these types of devices. Server-side platforms are also recommended for non-phone devices, such as TV browsers, gaming devices, ereaders, etc.

New! Demo the JavaScript API using your device.

GLOBAL INFO

  • GetUserAgent(): Not supported. Instead, we use a local variable called “uagent”.
  • GetHttpAccept(): Not supported.

DETECTION METHOD RETURN VALUES

All DetectXXX() methods return the booleans TRUE or FALSE (when supported!).

 

DETECTION METHODS: Device Tiers

These methods group mobile phones into three broad tiers based on the capabilities of their browsers. See the regular API notes to see a list of devices falling into each tier.

  • DetectTierTablet(): Well supported in this class.
  • DetectTierIphone(): Well supported in this class.
  • DetectTierRichCss(): Poorly supported in this class.
  • DetectTierOtherPhones(): Very poorly supported in this class.

 

DETECTION METHODS: Classes of Devices

These methods are also poorly supported among mobile devices. Instead of these methods, we recommend using the tier detection methods above in most cases.

  • DetectSmartphone(): Poorly supported even in this class.
  • DetectMobileQuick(): Very poorly supported.
  • DetectMobileLong(): Very poorly supported.
  • DetectGameConsole(): Rolls all of the gaming consoles up into a single method. Poorly supported.

 

DETECTION METHODS: Platforms and OSes

Assume that all of the following methods probably won’t work. If they work, they probably work only for iPhone Tier devices. Some methods have additional notes.

  • DetectIphone()
  • DetectIpod()
  • DetectIpad()
  • DetectIphoneOrIpod()
  • DetectIos(): A convenience method for catching any iOS device.
  • DetectAndroid(): Detects any Android device: phones, multi-media players, tablets, and Google TV.
  • DetectAndroidPhone(): Includes phones and multi-media players; excludes tablets. Some phones running mobile OSes with small marketshare will report as ‘like Android,’ so will test positive here.
  • DetectAndroidTablet()
  • DetectGoogleTV()
  • DetectAndroidWebKit()
  • DetectWebkit()
  • DetectWindowsPhone(): For Windows Phone 7, 8 and 10.
  • DetectWindowsPhone7()
  • DetectWindowsPhone8()
  • DetectWindowsPhone10()
  • DetectWindowsMobile(): Might work for some of the newest devices if the JavaScript is included inline in the HTML.  (Legacy Windows Mobile before Windows Phone was launched)
  • DetectBlackBerry(): JavaScript is almost completely unsupported on BlackBerry 5.xx devices.
  • DetectBlackBerry10Phone(): For BlackBerry phones running the new BB OS 10.
  • DetectBlackBerryTablet(): For the PlayBook
  • DetectBlackBerryWebKit()
  • DetectBlackBerryTouch(): Probably won’t work for devices in this group.
  • DetectBlackBerryHigh(): Probably won’t work for devices in this group.
  • DetectBlackBerryLow(): Probably won’t work for devices in this group.
  • DetectS60OssBrowser(): This is the WebKit-based browser rather than the older proprietary browser Nokia used.
  • DetectSymbianOS(): Probably won’t work for most Symbian devices. Might work for the newest S60-based devices.
  • DetectPalmOS(): Probably won’t work for this platform.
  • DetectPalmWebOS()
  • DetectWebOSTablet()
  • DetectWebOSTV(): Primarily from LG, but also Panasonic.
  • DetectOperaMobile()
  • DetectKindle()
  • DetectAmazonSilk(): Detects the Android-based Amazon Kindle Fire when the Silk acceleration mode is on.
  • DetectGarminNuvifone()
  • DetectBada()
  • DetectTizen()
  • DetectTizenTV(): Primarily from Samsung.
  • DetectMeego()
  • DetectMeegoPhone()
  • DetectFirefoxOS(): Detects a mobile device (probably) running the Firefox OS. (Firefox don’t differentiate between Firefox OS and their browser running on other mobile platforms.)
  • DetectFirefoxOSPhone()
  • DetectFirefoxOSTablet()
  • DetectSailfish()
  • DetectSailfishPhone()
  • DetectUbuntu(): Detects either phones or tablets running Ubuntu Mobile OS.
  • DetectUbuntuPhone()
  • DetectUbuntuTablet()
  • DetectDangerHiptop()
  • DetectSonyMylo(): An old Sony home Internet tablet.
  • DetectMaemoTablet(): An old Nokia home Internet tablet (pre-Meego).
  • DetectArchos(): For Archos’ older non-Android-based video and music players.
  • DetectGameConsole(): A single method to detect all supported game consoles.
  • DetectXbox()
  • DetectSonyPlaystation()
  • DetectNintendo()
  • DetectGamingHandheld(): Includes the Playstation Vita.
  • DetectBrewDevice(): Probably won’t work for devices in this group.
  • DetectWapWml(): Not supported.
  • DetectMidpCapable(): Not supported.
0 comments on “MobileESP API: JavaScript
1 Pings/Trackbacks for "MobileESP API: JavaScript"
  1. […] Detectar un Iphone o Ipad para que tengas una idea mejor de como trabaja revisa este link […]