我正在使用 vs2012,我正在开发一个 PhoneGap 应用程序,在该应用程序中我使用以下 JavaScript 代码:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
// alert("hh");
console.log("Entering index.html.onDeviceReady");
//var element = document.getElementById('deviceProperties');
var html = "";
html = html + "<li>" + 'Device Name: ' + device.name + "</li>";
html = html + "<li>" + 'Device Cordova: ' + device.cordova + "</li>";
html = html + "<li>" + 'Device Platform: ' + device.platform + "</li>";
html = html + "<li>" + 'Device UUID: ' + device.uuid + "</li>";
console.log(html);
$("#deviceProperties").html(html);
$("#deviceProperties").listview('refresh');
console.log("Exiting index.html.onDeviceReady");
}
但是该函数没有被调用,也没有动态添加任何元素。我究竟做错了什么?