Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    laoyao
    @laoyao
    Anyone meet this satuation?
    Christopher J. Brody
    @brodybits
    Do you mean that you can only run one transaction, or do you try to try to run the same transaction multiple times (which is not allowed)
    ?
    laoyao
    @laoyao
    Same transaction run on click event
    First click return the result
    second click has no response
    Christopher J. Brody
    @brodybits
    Do you mean that the click event handler has code that executes a transaction with a callback, and after the second click the transaction callback function is not called?
    laoyao
    @laoyao
    Yeah
    function query(){
            db.transaction(function(tx) {
                tx.executeSql("select distinct contractor_name from construction_range;", [], function(tx,res) {
                    alert(JSON.stringify(res));
                });
            });
         }
    my function
    is there any problem?
    Christopher J. Brody
    @brodybits
    I do not recommend using JSON.stringify(res), since res is not really a JSON object.
    res has the following members: rows, rowsAffected, and sometimes insertId. The rows member has a length member and an item function.
    laoyao
    @laoyao
    ok
    but the second click has no response,any soluation?
    can u give me some advise?
    Christopher J. Brody
    @brodybits
    Try changing the alert statement to something like: alert("res.rows.length: " + res.rows.length + (res.rows.length == 0) ? "" : " item(0): " + JSON.stringify(res.rows.item(0)));
    laoyao
    @laoyao
    i change alert(“run”), but second click not called
    is this a bug?
    when i change this line:

    SQLitePlugin.prototype.transaction = function(fn, error, success) {
    if (!this.openDBs[this.dbname]) {
    error(newSQLError('database not open'));
    return;
    }
    // To Fix
    // this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, false));
    this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, false));

    };

    in sqliteplugin.js, then the second is called
    Christopher J. Brody
    @brodybits
    This does not look right. I will try it myself and let you know.
    laoyao
    @laoyao
    many thanks
    in my project i change the opendb method like following:
    opendb: argsArray(function(args) {
    var errorcb, okcb, openargs;
    openargs = {
    name: args[0]
    };
    okcb = args1;
    errorcb = args2;
    return new SQLitePlugin(openargs, okcb, errorcb);
    }),
    is there any problem?
    okcb = args1;
    errorcb = args2;
    Christopher J. Brody
    @brodybits
    I cannot see any problem here
    What if you would do your test with a statement like this: tx.executeSql("SELECT 1;", [], function(tx, res) { alert("SELECT 1 OK"); });
    Christopher J. Brody
    @brodybits
    would you still see the same issue?
    laoyao
    @laoyao
    still have the problem
    Christopher J. Brody
    @brodybits
    I am trying to reproduce it, hang on
    laoyao
    @laoyao
    many thanks
    Christopher J. Brody
    @brodybits
    I spent 2-3 hours trying to get click events until I discovered this article: http://www.shdon.com/blog/2013/06/07/why-your-click-events-don-t-work-on-mobile-safari
    Christopher J. Brody
    @brodybits
    @laoyao when I try the test in a fresh project (using JQuery Mobile) it is working OK for me. Can you please try it in a fresh project?
    laoyao
    @laoyao
    i make some custom code in sqliteplugin.js and sqliteplugin.m
    i give the custom file to u?can you help me test it in your fresh project?
    @brodybits
    Christopher J. Brody
    @brodybits
    You say that you see the problem when you run the custom code? Best if you can send me the results of git diff. You can send it in the private chat or to info@litehelpers.net
    laoyao
    @laoyao
    ok i will give you a email
    Christopher J. Brody
    @brodybits
    You can send either the results of git diff, or just send your version of SQLitePlugin.js & SQLitePlugin.m, if you like.
    laoyao
    @laoyao
    i send the js and m file
    Sven Roeterdink
    @swennemans
    He guys, I'm comparing performance on Phonegap vs Swift. I'm doing some actions that I want to benchmark.
    I'm here just checking to see if my code is not completely off, could someone take a quick glance at it, and maybe give advice?
    My function where the inserting happens is:
    function loadDocs(tx) {
      var q = "INSERT INTO test_table (data, data_num) VALUES (?,?)";
      for (var i = 0; i < 1500; i++) {
          tx.executeSql(q, ["test", i], function (tx, res) {
           })
       }
    }

    and then:

     var startTime = (Date.now() / 1000);
     db.transaction(loadDocs, [], querySuccess, errorCB);

    I stop timing in my succesCB.

    Thanks :smile: :shipit:
    Christopher J. Brody
    @brodybits
    Looks OK to me
    Chun-Sheng, Li
    @peter279k
    blob
    Hi everyone,I follow this Manual installation - Android version.I install the library (step by step).
    I used the js sample code but it was not worked.They output the error message: "database not open"
    I don't know what happen and I am sure I have included the libraries correctly.Thaks for help me.