我无法删除我的 PouchDB 以重置我的 jQuery Mobile 应用程序。
(等效的 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()
有什么建议么?我已经在http://pouchdb.com/api.html#delete_database检查了 API 文档,但没有找到太多帮助。