nocksock
nocksock

Reputation: 5527

A lot of html-code generated in jQuery. Searching for better ways

I'm currently writing some jQuery-Stuff that works a lot with js-generated HTML. Since I'm working in a team I thought of searching for template engines for jQuery. On the other side performance is very important and I thought that template engines in js might eat up too much of it.

What is the best (most maintainable and performant) solution to work with a lot of generating repeating html-code in jQuery? I heard of jBind and jTemplates. What would you recommend if any?

Upvotes: 0

Views: 136

Answers (3)

jAndy
jAndy

Reputation: 236102

I also think that the jQuery template plugin is a pretty neat script. Afaik, they adopted it from Resig's Microtemplating approach, which already was cool stuff.

Anyway, if performance really matters, no clientsite rendering engine can mess with serverside rendering engines today. You still can combine this, by using a serverside rendering engine you can pass the completely renedered HTML code along with other (optional) data to your clients by using JSON. I guess that technique is pretty common.

Ref.: jQuery template plugin

Upvotes: 1

jonagoldman
jonagoldman

Reputation: 8754

I have been playing a little bit with jQuery official Templates plugin and I think is the best option out there. Its based on code written by the creator of the jQuery library so you can trust it.

Right now is beta but it can be used without any problem. I have tested it for a big project and have no problems with it.

Hope it helps.

Upvotes: 1

Giorgi
Giorgi

Reputation: 30883

Have a look at jQuery Templates plugin. Currently it's beta only but it will become part of jQuery. For better performance make sure that the template is compiled only once.

Upvotes: 1

Related Questions