我有以下回应:
var resp = {
name: "menu svc", // some basic info about the menu, not displayed in UI
style: "topmenucontainer",
childstyle: "topmenu",
type: "MENU",
"nodes": [{ // has the menu hierarchy info
name: "Process",
href: "some url",
embedData: "true",
instances: [{
"title": "Proc1",
"url": ""
}, {
"title": "Proc2",
"url": ""
}, {
"title": "Proc3",
"url": ""
}],
nodes: [{
name: "Documents",
href: "url3",
embedData: "true",
instances: [{
"title": "Doc1",
"url": "url1"
}, {
"title": "Doc2",
"url": "url2"
}],
nodes: []
}]
}]
};
我必须基本上创建一个菜单结构如下:
Process
Proc1---------------->Documents
Proc2 Doc1-------------------------->
Proc3 Doc2
因此,特定节点的所有实例将在节点下列为li,并且每个子节点应在每个父节点实例中列为ul。 同样,它的一个递归结构作为子节点将包含孙子节点ans应该以类似的方式显示。
任何指针?
由于
答案 0 :(得分:0)
你可以试试这个:
$("#header ul").append('<li><ul><li></li><li></li><li></li></ul></li>');
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="header">
<ul>
</ul>
</div>
&#13;