Templates in JS?

前端 未结 4 990
花落未央
花落未央 2021-01-17 03:55

All we like simple, structured code that is easy to comply with. We try to bring a difference between appearance and logics. In PHP, for instance, we can use a template mech

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 04:38

    There are many js template engin as below. Choose as you want. Handlebars is my suggestion.

    1. Handlebars. http://handlebarsjs.com/
    2. jquery template. http://api.jquery.com/jQuery.template/
    3. Ejs http://embeddedjs.com/.
    4. Underscore has template engin. http://documentcloud.github.com/underscore/#template
    5. trimpath http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
    6. John Resig's micro template engin. http://ejohn.org/blog/javascript-micro-templating/
    7. mustaches is also a good one. https://github.com/janl/mustache.js/

提交回复
热议问题