Create nested UL lists from data object

前端 未结 5 728
南笙
南笙 2020-12-14 05:21

I\'m trying to create a nested UL from JSON. I am able to loop through and grab the data from the object, but I am having trouble building the nested UL. I figure the \'.app

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 05:26

    Here's how to do this with the jQuery template plugin I mentioned

    This would be in your script tag:

    $(function () {
        $('#t_menu').tmpl(menu).appendTo('#test');
    });
    

    And this in your html :

提交回复
热议问题