У меня возникли проблемы с удалением моей 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()
Какие-либо предложения? Я уже ознакомился с документацией по API на странице http://pouchdb.com/api.html#delete_database но особой помощи там не нашел.