0
我有這樣的XML響應:http://jsfiddle.net/ZeeHv/解析數據來創建一個導航窗格
我試圖使用從垃圾堆裏的信息來創建這樣的事情:
<UL>
<li>Academic
<ul>
<li>BM</li>
<li>CMTTE</LI>
<li>DM</li>
<li>PM</li>
</ul>
</li>
</ul>
<ul>
<li>ARCHIVE</li>
</UL>
<ul>
<LI>ASSOCIATIONS
<ul>
<li>BM</li>
<li>DM</LI>
<li>PM</li>
</ul>
</LI>
</ul>
到底XML可以給我我所有的網站和subsits的列表:
https://hosted.demo.ca
https://hosted.demo.ca/academic
https://hosted.demo.ca/academic/bm
https://hosted.demo.ca/academic/cmtte
https://hosted.demo.ca/academic/dm
https://hosted.demo.ca/academic/pm
https://hosted.demo.ca/archive
https://hosted.demo.ca/associations
https://hosted.demo.ca/associations/bm
https://hosted.demo.ca/associations/dm
https://hosted.demo.ca/associations/pm
我怎樣才能通過這個信息,並追加UL和李標籤來創建一個站點導航菜單?用於獲取XML
JS:
function getAllSites(){
$().SPServices({
operation: "GetAllSubWebCollection",
async: true,
completefunc: function(xData, Status){
$(xData.responseXML).find("Web").each(function(){
console.log($(this).attr("Url"));
});
}
});
}
你讓我非常接近我想要做的事情,但它看起來像你教我想分組在一起。 (即所有1級坐在一起,所有lv2站點都會去等等)。這不完全是我想要完成的。我已經更新了我的OP,向你展示我的意思 – Batman