无法理解为什么会这样:
var request=window.indexedDB.open("known"); //async IDB request
request.onsuccess=function(){db=event.target.result;
alert("database created"+db); //it works fine database created
var store=db.createObjectStore("friends",{pathKey:"name"})
//error **"Uncaught InvalidStateError: An operation was called on an object on which it is not allowed or at a time when it is not allowed."** as on console box
}
当参考数据库“已知”分配 db 时,为什么会弹出错误?