Created
June 23, 2016 16:11
-
-
Save laphilosophia/33052e84c87141150900a2d22fe6035c to your computer and use it in GitHub Desktop.
Detect android version with javascript.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAndroidVersion(ua) { | |
ua = (ua || navigator.userAgent).toLowerCase(); | |
var match = ua.match(/android\s([0-9\.]*)/); | |
return match ? match[1] : false; | |
}; | |
var androidVersion = parseFloat(getAndroidVersion()); | |
if (androidVersion === 4.4) { | |
// .. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment