var store = store = db.transaction(storename,'readwrite').objectStore(storename),request
请问这条语句什么意思啊
或者说下面为啥可以防止添加数据
//添加数据,重复添加会报错
var store = store = db.transaction(storename,'readwrite').objectStore(storename),request;
for(var i = 0 ; i < data.length;i++){
request = store.add(data[i]);
request.onerror = function(){
console.error('add添加数据库中已有该数据')
};
request.onsuccess = function(){
console.log('add添加数据已存入数据库')
};
}