Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = function() {
- that = this;
- };
- // Application Constructor
- app.prototype.initialize = function() {
- this.bindEvents();
- };
- // Bind Event Listeners
- //
- // Bind any events that are required on startup. Common events are:
- // 'load', 'deviceready', 'offline', and 'online'.
- app.prototype.bindEvents = function() {
- document.addEventListener('deviceready', this.onDeviceReady, false);
- };
- // deviceready Event Handler
- //
- // The scope of 'this' is the event. In order to call the 'receivedEvent'
- // function, we must explicity call 'app.receivedEvent(...);'
- app.prototype.onDeviceReady = function() {
- this.receivedEvent('deviceready');
- this.db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
- this.db.transaction(this.populateDB, this.errorCB, this.successCB);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement