开发者

Try to create HTML5 table in WebOS but failed

开发者 https://www.devze.com 2023-02-06 11:37 出处:网络
I try to create HTML5 table in WebOS using following JavaScript, but the table is not created. However i ca开发者_如何学JAVAn\'t see any further detail in the log other than the first Mojo.log \"Try t

I try to create HTML5 table in WebOS using following JavaScript, but the table is not created. However i ca开发者_如何学JAVAn't see any further detail in the log other than the first Mojo.log "Try to create database".

2011-01-25T15:48:50.251507Z [43854] qemux86 user.notice LunaSysMgr: {LunaSysMgrJS}: com.palm.phonegap: Info: Try to create database, palmInitFramework347:2527

Do you have any idea?

Thanks..

    var db;

    function openDb(){
      var shortName = 'mcrm';
      var version = '1.0';
      var displayName = 'mCRM'
      var maxSize = 65536;
      db = openDatabase(shortName, version, displayName, maxSize);

      try {
            db.transaction(
          function(transaction) {
            Mojo.Log.info("Try to create database");      
            transaction.executeSql(
              'CREATE TABLE IF NOT EXISTS bookmarks' 
              + ' (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, '
              + ' resource_id INTEGER NOT NULL '
              + ' resource_type TEXT NOT NULL '
              + ' url TEXT NOT NULL );',
            function() {
              Mojo.Log.info("DATABASE CREATED");     
            },
            errorHandler
            );
          }
      );
      Mojo.Log.info("Is it no error?");   
  } 

function errorHandler(transaction, error) {
  Mojo.Log.info("ooopss. Error was ", error.message , " ;Error code:", error.code);
  return true;
}


  1. the cause of log file is not giving err message i.e. missing one argument of executeSql
  2. the cause of the error i.e. missing comma at CREATE TABLE statement
0

精彩评论

暂无评论...
验证码 换一张
取 消