[JavaScript]get OS version
get OS version
function getiOSVersion(){ if (/iP(hone|od|ad)/.test(navigator.userAgent)) { var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); return parseInt(parseInt(v[1], 10).toString()+parseInt(v[2], 10).toString()+parseInt(v[3] || 0, 10).toString() ,10); } return 0.0; } function getAndroidVersion(){ if( navigator.userAgent.indexOf("Android") > 0 ) { var v = navigator.userAgent.match(/Android [\d\.]+/)[0].split(' ').pop().split('.'); return parseInt(parseInt(v[0], 10).toString()+parseInt(v[1], 10).toString()+parseInt(v[2] || 0, 10).toString() ,10); } return 0.0; }