jquery templates: How to create a template for unknown type
I just started lo开发者_C百科oking at the jquery-tmpl and was wondering if it would be possible to create a template that would render an unknown type. Basically a generic template that would take a JSON object and render all of values found on the object?
Use the each template tag
{{each(key, value) jsonObject}}
<p>${key}: ${value}</p>
{{/each}}
精彩评论