Skip to content

Instantly share code, notes, and snippets.

@benvium
Created March 27, 2013 12:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save benvium/5253858 to your computer and use it in GitHub Desktop.
Save benvium/5253858 to your computer and use it in GitHub Desktop.
detect Android OS version number in JavaScript. Found at http://krpano.com/forum/wbb/index.php?page=Thread&threadID=6652
var ua = navigator.userAgent;
if( ua.indexOf("Android") >= 0 )
{
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8));
if (androidversion < 2.3)
{
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment