jQuery Templates are deprecated?

末鹿安然 提交于 2019-11-28 04:22:00
Alex Sexton

jQuery Templates are not dead, they just aren't going in as an official template language of the project. The maintainer of that project will likely still make some updates (and has plans to redo quite a bit of it in the future).

JavaScriptMVC is quite a bit more complex than just templates and you can use just about any templating language that you want with it.

Some of the more popular templating languages these days are Mustache/Handlebars, Dust.js, Haml, Embedded JavaScript, and a few others. The first three are actually pretty similar syntax to the jQuery templates with the exception that they don't natively create jQuery object for your element. That's easy to add though.

I think this post can give you some insight and possibly some food for thought. http://www.borismoore.com/2011/10/jquery-templates-and-jsviews-roadmap.html

Yes, a lot of people are pissed off about the abandonment of jQuery Templates (among other things). On the bright side, some sort of templating will be implemented in the new jQuery UI (not sure if this is out yet or not). Your best bet is to look for an alternative templating engine.

A comparison table is provided on the jQuery wiki.

I have used both jQuery template as well as handlebars. IMHO, handlebars is way better than jquery template in terms of usage, clarity of code and speed. Handlebars pre-compiled templates load really fast on various browsers comparatively. Check out this link for comparison of different templating engines: http://jsperf.com/jquery-template-table-performance/134

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!