tx.executeSQL('&#39);不是从第二页申请中获得的

时间:2014-08-20 09:29:04

标签: android sqlite cordova web-sql

function onDeviceReady() {
    var db = window.sqlitePlugin.openDatabase({name: "mydb"});
    alert("open");
    db.transaction(function(tx) {   
          alert("transaction");
          tx.executeSql('select * from mytable',[],function(tx,rs) {
            alert("select");
           });

    });

}

我的应用程序中有两个页面,index.html和second.html。 如果我在index.html上调用此代码,它会正确警告"打开" - "事务" - "选择"。但是当我离开index.html并之后转到second.html时,它不会警告"选择",它也不会抛出异常或调用我可选择包含的错误回调函数。除了提醒"打开" - "交易"它什么都不做。如果我直接转到second.html而不从index.html调用脚本,它运行良好。问题似乎只发生在第二次调用脚本 - 或其部分 - 时。 谁可以帮忙?

0 个答案:

没有答案