Recommended JavaScript HTML template library for JQuery? [closed] Recommended JavaScript HTML template library for JQuery? [closed] javascript javascript

Recommended JavaScript HTML template library for JQuery? [closed]


Well, to be frank, client-side templating is very hot nowadays, but quite a jungle.

the most popular are, I believe:

  • pure: It use only js, not his own"syntax"
  • mustache: quite stable and nice Iheard.
  • jqote2: extremely fastaccording to jsperfs
  • jquery templates (deprecated):

there are plenty others, but you have to test them to see what suits you, and your project style, best.

Personally, I have a hard time with adding a new syntax and set of logic (mixing logic and template, hello??), and went pure js. Every single one of my templates is stored in it's own html file (./usersTable.row.html). I use templates only when ajaxing content, and I have few "logic" js files, one for tables, one for div, one for lists. and not even one for select's options (where i use another method).

Each time I tried to do something more complex, I found out the code was less clear and taking me more time to stabilize than doing it the "old" way. Logic in the template is an utter non-sense in my opinion, and adding it's own syntax adds only very-hard-to-trace bugs.


jTemplates

a template engine for JavaScript.

Plugin to jQuery...

Features:

  • 100% in JavaScript
  • precompilator
  • Support JSON
  • Work with Ajax
  • Allow to use JavaScript code inside template
  • Allow to build cascading templates
  • Allow to define parameters in templates
  • Live Refresh! - automatic update content from server...


There is a reasonable discussion document on this topic here, which covers a range of templating tools. Not specific to jQuery, though.