views:

249

answers:

6

I have looked at jTemplates and it's worth a try. Are there any other template engines other than jTemplates?

A: 

Its worth looking at the following link.

http://wiki.github.com/nje/jquery/jquery-templates-proposal

Amitabh
A: 

I liked the approach the JavaScriptMVC Frameworks Views take, especially because it uses JavaScript itself as the templating language. The framework is now based on jQuery and you can render your Model right into the views (Model supports JSON, JSONP, XML etc.).

Daff
A: 

Yajet is a new one, spotting a syntax different from anything we've seen before. :-) It compiles the templates and it's blazing fast. It's browser and library-agnostic; there is a small jQuery wrapper for people who can't live without jQuery, but the engine itself is independent and can run in Rhino or V8 too.

It supports many directives that allow conditionals, loops, define reusable template components etc.

mishoo
+1  A: 

Here is one implemented in jQuery for the Smarty templating language. http://www.balupton.com/sandbox/jquery-smarty/demo/

One impressive feature is the support for dynamic updates. So if you update a template variable, it will update anywhere in the template where that variable is used. Pretty nifty.

You can also hook into variable changes using a onchange event. So that is useful for say performing effects or AJAX when say the variable "page" changes ;-)

balupton
+2  A: 

Did you try pure.js ?

The main difference with the dozens of JS templating engines available is that PURE leaves the HTML totally separated from the JS logic. And it's pretty fast too.

However it is not the common <% ... %> kind of templating programming you may like.
It has a pattern/declarative approach which has some similarity with XSLT (but without the pain...)

Mic
A: 

But can we use pure for dynamic pages? like integrating with struts?

Manish