Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimalist, Tiny Javascript Template System?

I'm looking for a minimalist template system for javascript, ala John Resig's Javascript Micro Templating. The smaller the better, and if it's jquery based even better. Recommendations?

I tried John's micro-templating but ran into a few issues, wanted to see if there are more baked / better packaged solutions out there.

[Update] I tried Resig's Micro Templating again and it's working well for me. Would still like to hear about other alternatives if there are any.

like image 653
Parand Avatar asked Mar 05 '10 17:03

Parand


2 Answers

There is also Mustache.js, it has a neat syntax IMO.

like image 114
Chubas Avatar answered Oct 16 '22 03:10

Chubas


This one is good and tiny (400bytes gzipped or 600bytes minified). Also has the attractive {{hello}} syntax rather than the <?php hideous ?> <%whats-the-point-might-as-well-not-bother-with-templates%> syntax

https://github.com/jasonmoo/t.js

Slightly larger but still very good (personally only tested mustache):

https://github.com/janl/mustache.js

http://tempojs.com/

https://github.com/premasagar/tim (370 bytes for the 'tinytim' version)

like image 20
Dominic Avatar answered Oct 16 '22 02:10

Dominic