Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var app = function() {
  2.     that = this;
  3. };
  4.  
  5. // Application Constructor
  6. app.prototype.initialize = function() {
  7.     this.bindEvents();
  8. };
  9. // Bind Event Listeners
  10. //
  11. // Bind any events that are required on startup. Common events are:
  12. // 'load', 'deviceready', 'offline', and 'online'.
  13. app.prototype.bindEvents = function() {
  14.     document.addEventListener('deviceready', this.onDeviceReady, false);
  15. };
  16.  
  17. // deviceready Event Handler
  18. //
  19. // The scope of 'this' is the event. In order to call the 'receivedEvent'
  20. // function, we must explicity call 'app.receivedEvent(...);'
  21. app.prototype.onDeviceReady = function() {
  22.     this.receivedEvent('deviceready');
  23.     this.db = window.openDatabase("Database", "1.0", "Cordova Demo", 200000);
  24.     this.db.transaction(this.populateDB, this.errorCB, this.successCB);
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement