0
我正在开发使用jquery mobile和pouchdb的简单移动应用程序。我通过这个链接http://pouchdb.com/getting-started.html跟着教程。如何从pouchdb数据填充jquery移动列表视图
我想填充从pouchdb数据检索Jquery Mobile listview。例如名(大卫),每一个该名称将链接到提供完整的信息,例如其电子邮件,年龄等新的一页
我被困在这条线
功能redrawUi(MYDB){
这里是一个源代码。 http://jsfiddle.net/Vanilla/p2u8wc5p/
在此先感谢。
var db = new PouchDB('mydb');
var remoteCouch = 'http://localhost:5984/mydb';
db.info(function(err, info) {
db.changes({
since: info.update_seq,
live: true
}).on('change', showTodos);
});
db.put({
_id: new Date().toISOString(),
email: '[email protected]',
name: 'David',
});
db.changes().on('change', function() {
console.log('Ch-Ch-Changes');
});
db.replicate.to('http://127.0.0.1:5984/mydb');
db.replicate.from('http://127.0.0.1:5984/mydb');
function showdetail() {
db.allDocs({
include_docs: true,
descending: true
}).then(function(doc) {
redrawUi(doc.rows);
}).
catch(function(err) {
console.log(err);
});
}
function redrawUi(mydb) {
});
}
它现在工作正常....但我需要使每个项目链接到新页面。例如[link](http://jsfiddle.net/hungerpain/52Haa) – Bmc 2014-11-25 19:19:40
@Bmc,只需在li中包含一个锚标签:itemsHTML + ='
我要做的是,当点击大卫...它会带来新的页面,给予详细的电子邮件,全名等...你有什么想法? – Bmc 2014-11-26 05:00:41