我很难删除我的PouchDB来重置我的jQuery移动应用程序。
(等效jsFiddle:http://jsfiddle.net/bYR8c/2/)
我在app.js
var db = new PouchDB('petrolog');
function resetDb(){
db.destroy(function(err, info) { console.log('Error: ' + err);
console.log('Info: ' + info); }); //this is line 38, referenced in errors below
showFillups(); //redraws the UI
}在index.html中
<head>
<script src="http://download.pouchdb.com/pouchdb-nightly.js"></script>
</head>
<body>
<a id="btnResetDb" class="ui-shadow ui-btn ui-corner-all">Erase all fillups</a>
<script> $('#btnResetDb').click(function(event){resetDb();}); </script>
</body>单击该按钮时,可以从FireBug获得以下信息:
Error: null app.js (line 38)
Info: undefined app.js (line 38)这些与我在db.destroy()中的resetDb()指令相对应。
有什么建议吗?我已经在database上检查了API文档,但在那里没有找到多少帮助。
发布于 2014-04-17 22:25:28
destroy()方法实际上并不返回info的任何内容。error为null的事实表明一切都是成功的。
这实际上是PouchDB文档中的一个bug,我们将修复它。
FWIW,但是,您的jsfiddle不工作的原因无关:小提琴环境似乎无法访问任何本地数据库,所以在火狐我看到Error: No valid adapter found。
https://stackoverflow.com/questions/22721451
复制相似问题