2 ms·
Sure -- I tend to strongly prefer libraries that simply allow you to interpolate JavaScript, nothing more and nothing less, so our Underscore.js templates work
by jashkenas 15y ago
Sure -- I tend to strongly prefer libraries that simply allow you to interpolate JavaScript, nothing more and nothing less, so our Underscore.js templates work fine: http://documentcloud.github.com/underscore/#template http://documentcloud.github.com/underscore/#template
On the other hand, if you're looking to share templates between the client-side and server-side, and you're not using JavaScript on the server end, there's a strong case to be made for "logic-less" templates that can be rendered (at least in theory), by Ruby or Python just as easily as JavaScript. Check out Mustache: http://mustache.github.com/ http://mustache.github.com/
There's also HAML, Jade, Eco, Handlebars, and many, many more.