Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended JavaScript HTML template library for JQuery? [closed]

Any suggestions on which HTML template library would go well with JQuery? Googling turns up quite a number of libraries but I'm not sure whether there is a well recognized library that would stand the test of time.

like image 481
Shiva Avatar asked Jan 16 '09 07:01

Shiva


People also ask

Is there a JavaScript template?

Javascript templates are rendered and cached client-side without sending an HTTP request to the server — in other words, they're lightning fast. Speed benefits aside, Javascript templates also afford us the opportunity to abstract the HiFi administrative UI into a simple Javascript API.

What can a JavaScript library like JQuery do for you?

jQuery is a lightweight, open-source JavaScript library that helps us build interactive web pages with animations, visual effects, and advanced functionality. It is the most popular JavaScript library, used by around 70 million websites worldwide.


1 Answers

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 I heard.
  • jqote2: extremely fast according 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.

like image 146
roselan Avatar answered Sep 22 '22 13:09

roselan