嗨,我正在用 css jquery 和 javascript 编写菜单列表:我想从数据库中获取菜单项
js代码:
var selectAllStatement = "SELECT * FROM Contacts";
function findAll(){
var name;
db.transaction(function(tx) {
tx.executeSql(selectAllStatement, [], function(tx, result) {
dataset = result.rows;
for (var i = 0, item = null; i < dataset.length; i++) {
item = dataset.item(i);
name = item['firstName'] }
});
});
}
.html 文件:
<section id="popupAccordeon" class="hide">
<div id="popup-bg">
</div>
<div id="popup-box">
<ul class="niveau1">
<li><a href=""> Players Name</a>
<ul class="niveau2">
<li><a href="http://www.rankspirit.com"> </a></li> // this are items i want to get them from table Contacts
</ul>
</section>