Last active
August 29, 2015 14:04
-
-
Save seanwalsh/df4d628cd7b41cbbab9b to your computer and use it in GitHub Desktop.
Testing for Android less then 4.3
This file contains 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
// Test for Android < 4.4 | |
var nua = navigator.userAgent; | |
var nuaStart = navigator.userAgent.indexOf("Android "); | |
var nauVersion = navigator.userAgent.substr(nuaStart+8,3) | |
if (nauVersion < 4.4 ) { | |
document.documentElement.className += ' droid'; } |
This file contains 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
// Test for Android < 4.4 | |
var nua = navigator.userAgent; | |
var nuaStart = navigator.userAgent.indexOf("Android "); | |
var nauVersion = navigator.userAgent.substr(nuaStart+8,3) | |
if (nauVersion < 4.4 ) { | |
document.documentElement.className += ' droid droid-' + nauVersion.replace(".", "0"); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment