Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript template engines. Reasons to use

What reasons for using javascript template engines do you know? When to use and to avoid using it?

And do we need to use JTE like underscore.js, when we already have framework like jQuery installed?

Also, what template engines for using with jQuery you can recommend?

like image 714
Nikolay Fominyh Avatar asked Feb 25 '26 06:02

Nikolay Fominyh


1 Answers

Older browsers lack of new ecmascript/javascript functions and features. When you need to use latest functions (map, reduce) and features (html5, css3, websockets) you may need that kind of libraries like Underscore, modernizr etc. They are also shorten your code. Underscore has useful utility/helper functions that you can use.

  • jQuery: DOM library
  • Underscore: General use for arrays/objecys
  • Modernizr: HTML5, websockets, canvas
  • Sass: CSS library
  • Templating: Jade, Mustache, ICanHaz.js

I personally using jade with node. It's very useful for quick view/renders.

like image 193
Erhan Avatar answered Feb 27 '26 18:02

Erhan