当前最好的Javascript模板引擎是什么? [英] What is the best current Javascript templating engine?

查看:120
本文介绍了当前最好的Javascript模板引擎是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,关于此主题有很多较旧的问题,这些问题指向许多可用的选项.例如,以下两个问题是该主题中最常回答的问题:

So there are a bunch of older questions on this topic that point to a number of options available. These two questions for example are some of the most answered on the topic:

JavaScript支持哪种良好的模板语言?

jQuery模板引擎

这两个问题的大部分答案都来自2008年.

Most of the answers to both questions are from 2008.

但是,在过去的一年左右的时间里,javascript的格局已经发生了很大的变化.例如,.NET JQuery扩展最近被添加为官方JQuery插件.

However in the past year or so the javascript landscape has evolved considerably. For example, the .NET JQuery extensions were recently added as official JQuery plugins.

在当前的模板引擎中,哪一种是最适合使用的?这是我知道的一些选项:

Out of the current templating engines, which is the best one to use? Here are some options I'm aware of:

  • jQuery-tmpl
    • JQuery-tmpl
      • https://github.com/jquery/jquery-tmpl
      • http://blog.jquery.com/2010/10/04/new-official-jquery-plugins-provide-templating-data-linking-and-globalization/
      • http://weblogs.asp.net/scottgu/archive/2010/10/04/jquery-templates-data-link-and-globalization-accepted-as-official-jquery-plugins.aspx
      • http://www.borismoore.com/2010/10/jquery-templates-is-now-official-jquery.html
      • (formerly an NJE project)
      • http://jtemplates.tpython.com/
      • http://plugins.jquery.com/project/jTemplates

      给出所有这些不同的选项,这可能是最好的选择?

      Given all these different options, which is probably the best one to choose?

      我试图在Resig的Microtemplates和JQuery-tmpl之间做出选择,但我不知道两者中哪个更好,或者是否有比这两个更好的选择.

      I was trying to decide between Resig's Microtemplates and JQuery-tmpl, but I don't know which of the two is better or if there is a better option than either of them.

      熟悉许多可用选项的任何人都可以就此事提供一些建议吗?

      Can anyone familiar with many of the options available lend some advice on this matter?

      推荐答案

      不应考虑ASP.NET Ajax库的DataView.在发布之前不推荐使用它,而推荐使用jQuery Templates.

      The ASP.NET Ajax Library's DataView should not be considered. It was deprecated before release, in favor of jQuery Templates.

      我已经使用jTemplates两年了,并且发现它足够可靠.但是,由于计划将其包含在jQuery 1.5核心中的jQuery模板,因此没有必要采用外部依赖关系来重新实现核心库中已经包含的某些内容.假设您使用的是jQuery,那么仅此一个理由就足以支持jQuery模板.

      I've been using jTemplates for a couple years and have found it to be solid enough. However, with jQuery Templates slated for inclusion in jQuery 1.5 core, it doesn't make sense to take an external dependency that re-implements something already included in the core library. That alone is enough reason to favor jQuery Templates, assuming you're using jQuery.

      这篇关于当前最好的Javascript模板引擎是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆