これがないドキュメントの最新バージョンです!
Click here for the latest released version.
device.version
オペレーティング システムのバージョンを取得します。
var string = device.version;
サポートされているプラットフォーム
- アンドロイド 2.1 +
- ブラックベリー WebWorks (OS 5.0 およびより高い)
- iOS
- Tizen
- Windows Phone 7 と 8
- Windows 8
簡単な例
//アンドロイド: フローズン ヨーグルト OS は「2.2」を返します/エクレア OS は「2.1」、「2.0.1」、または「2.0」を返します//バージョンも返すことができます/レベル"2.1 update1"を更新////ブラックベリー: トーチ 9800 OS 6.0 を使用しては「6.0.0.600」を返します////iPhone: iOS 3.2 返します「3.2」////Windows Phone 7: ex 現在の OS のバージョン番号を返します。 on Mango returns 7.10.7720
// Tizen: returns "TIZEN_20120425_2"
var deviceVersion = device.version;
完全な例
<!DOCTYPE html>
<html>
<head>
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for device API libraries to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// device APIs are available
//
function onDeviceReady() {
var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Model: ' + device.model + '<br />' +
'Device Cordova: ' + device.cordova + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
</head>
<body>
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>