作者:mobiledu2502887427 | 来源:互联网 | 2023-06-19 11:40
iamtryingtocreateanestedulbyreadingvaluesfromXMLfile.Iamabletocreatefirstlevelu
i am trying to create a nested ul by reading values from XML file. I am able to create first level ul but not able to add li elements under that. Firebug is not displaying any error. Please help code is given below;
我试图通过从XML文件中读取值来创建嵌套的ul。我能够创建第一级ul但不能在其下添加li元素。 Firebug没有显示任何错误。请帮助代码如下;
$(function(){
$.get("../XML/test.xml",processResult);
});
function processResult(data){
$(data).find("Category").each(showCategory);
}
function showCategory(){
var catName = $(this).attr("Title");
$("#menuList").append("");
$(this).find("Function").each(showFunction);
}
function showFunction(){
var funcName = $(this).attr("Title");
$(this.parentNode).append("" + funcName + "");
}
1 个解决方案