The AVD never displays the alert message (e.g. alert('initialized')
. I don't know whether the addEventListener works in my AVD or not.
I tried the following code also but it never worked:
function onLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
// PhoneGap is ready
function onDeviceReady()
{
var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device PhoneGap: ' + device.phonegap + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
</head>
<body onload="onLoad()">
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>
All it showed is - Loading device properties...but never showing the Device name etc. Can someone please help?
. I don't know whether the addEventListener works in my AVD or not.I tried the following code also but it never worked:
function onLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}
// PhoneGap is ready
function onDeviceReady()
{
var element = document.getElementById('deviceProperties');
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device PhoneGap: ' + device.phonegap + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
</head>
<body onload="onLoad()">
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>
All it showed is - Loading device properties...but never showing the Device name etc. Can someone please help?