これは単純化されたシナリオです。
var dbo = openDatabase('xxx','1.0','xxx', 1048576);
myPromise = new $.Deferred();
dbo.transaction(function(myTrans) {
myTrans.executeSql(
'SELECT * FROM myTable',
[],
function(tx, result) {
myPromise.resolve(result);
}
);
});
myPromise.done(function(result) {
var X = $('#result-template').html();
var template = Handlebars.compile(X);
template(result.rows);
});
2行目から最後の行まですべてが機能していると思います - template(result.rows) 行。
編集:これは、テーブルの削除、作成、入力、選択、および結果の表示(試行)からすべてを備えたjsFiddleです。