我正在运行以下代码,但我没有得到我期望的结果 - 我希望看到所有设备信息,但显示仍然是“正在加载......”。代码段来自here。我是科尔多瓦的新手,非常感谢你的帮助!!
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady(){
//device APIs are now available
var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device Cordova: ' + device.cordova + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Model: ' + device.model + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
<script>
ons.bootstrap();
window.onload = function() {
document.getElementById("buttonText").innerHTML= 'Log In';
}
</script>
<body>
<div style="text-align: Left">
<br>
<p> <strong>The following are details of this device</strong> </p>
<p id="deviceProperties">Loading... </p>
</div>
</body>