JDP 發表於 2014-12-2 09:37:50

Javascript 取得 Android 版本

function getAndroidVersion(ua) {
    var ua = ua || navigator.userAgent;
    var match = ua.match(/Android\s(*)/);
    return match ? match : false;
};

getAndroidVersion(); //"4.2.1"
parseInt(getAndroidVersion()); //4
parseFloat(getAndroidVersion()); //4.2Reference:
Pick up the Android version in the browser by Javascript
http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript
頁: [1]
查看完整版本: Javascript 取得 Android 版本