我正在使用 Xcode 并试图获取设备的信息,但它没有显示出来。这是我的代码
<!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, true);
// device APIs are available
function onDeviceReady() {
alert('1');
var status = device.platform;
alert('2');
alert(status);
$("#deviceProperties").html(status) ;}
</script>
</head>
<body>
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>
弹出警报(1),但它只是跳过警报(2)和警报(状态)。我正在使用 PhoneGap 3.0,我做错了什么?