我正在尝试使用phonegap将文件存储到数据库中。我收到一个错误,窗口对象不支持openDatabase。有谁能给我一个解决方案?我读过的所有文档都给出了相同的语法。我哪里错了?
storeInDB : function(csvBucketArr){
db = window.openDatabase("testDB" , "1.0", "testDB", 1000000);
db.transaction(app.setUp, app.errorHandler, app.dbReady);
console.log("DB ready!!");
},
setUp: function(tx){
tx.executeSql("create table if not exists fileLog(id INTEGER PRIMARY KEY AUTOINCREMENT, fileName TEXT UNIQUE, bucketName TEXT NOT NULL)");
},
errorHandler: function(e){
alert("ERROR :: " + e.message);
},
dbReady: function(csvBucketArr){
db.transaction(function(tx){
for(var i in csvBucketArr){
var fname = csvBucketArr[i].fileKey, bname = csvBucketsArr[i].bucketName;
tx.executeSql("insert into fileLog( fileName , bucketName) values (?,?)", [fname, bname]);
alert("In dbReady");
}
}, errorHandler, function(){alert("files added to the table");});
}