How to structure JSON and build HTML via jQuery

后端 未结 4 1476
臣服心动
臣服心动 2021-02-03 14:14

Beginner here trying to figure out best way to structure some JSON and output the below nested

    Each of the bolded items below are the values in the JSON. How

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-03 14:58

    I have become a big fan of mustache.js recently for doing exactly this kind of thing.

    http://github.com/janl/mustache.js/

    Edit:

    if I tweak calvinf's JSON format a little then this is an example using mustache.js:

    
      
       
        
        
        
      
      
       

    If you want a speed benchmark for JavaScript templating libraries I found this link useful:

    http://www.viget.com/extend/benchmarking-javascript-templating-libraries/

提交回复
热议问题