/*
* PhoneGap Essential Training by ninghao.net
*/
var app = {
// 应用构造器
initialize: function() {
this.bindEvents();
},
// 绑定事件监听器
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready 事件处理
onDeviceReady: function() {
app.receivedEvent('deviceready');
},
// 接收到事件以后更新 DOM
receivedEvent: function(id) {
var parentElement = document.getElementById(id);