Created
October 7, 2011 00:13
-
-
Save is8r/1269096 to your computer and use it in GitHub Desktop.
アンドロイドのバージョン判別
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
var bo = lowerAndroid(2.2); | |
alert(bo);//2.2(含まない)以下はtrue |
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 lowerAndroid(n) { | |
var bo = false; | |
var ua = navigator.userAgent.toLowerCase(); | |
var version = ua.substr(ua.indexOf('android')+8, 3); | |
if(ua.indexOf("android")) if(parseFloat(version) < n) bo = true; | |
return bo; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment