我是 phonegap 和 javascript html 的初学者。我不知道为什么事件 deviceready 没有触发并且 onload 没有执行。请帮助我,谢谢。
<html>
<head>
<title>My Device</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
// Use an event listener to detect if PhoneGap is ready
//
function onLoad() {
console.log("onload");
document.addEventListener("deviceready", onDeviceReady, false);
}
// okay, PhoneGap is ready
//
function onDeviceReady() {
console.log("deviceReady");
}
</script>
</head>
<body onload="onLoad()">
<p id="props">Loading device properties...</p>
</body>
</html>