How to structure JSON and build HTML via jQuery

后端 未结 4 929
不思量自难忘°
不思量自难忘° 2021-02-03 14:26

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:53

    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/

提交回复
热议问题