【问题标题】:jTemplates vs jQuery Templates. Which is one better? Is there a better? [closed]jTemplates 与 jQuery 模板。哪个更好?有更好的吗? [关闭]
【发布时间】:2011-05-10 20:47:33
【问题描述】:

我看到微软已经为 jQuery 创建了一个官方的 jQuery 模板插件。但我读过的 jTemplates 也很受欢迎。我不知道我是否应该不理会 jTemplates 并直接使用 jQuery 模板或尝试使用 jTemplates。

有什么建议吗?

注意:这是我第一次使用任何客户端模板框架。

【问题讨论】:

    标签: jquery jquery-templates jtemplates


    【解决方案1】:

    我很高兴using jTemplates for a couple years,但绝对推荐 jQuery 模板。以下是几个主要原因:

    • 除了使用 AJAX 请求来加载模板定义 (which is easy to overcome),jQuery 模板已经和 jTemplates 一样强大。事实上,我认为 jQuery Templates 的 {{tmpl}} 标签用于模板组合比 jTemplates 的 #include 更直观和直接。
    • 展望未来,围绕“官方”jQuery 模板解决方案的大量社区支持和开发将难以匹敌。
    • 由于 jQuery 模板将在 1.5 中加入到 jQuery 核心中,因此除了您已经通过 jQuery 免费获得的模板引擎之外,再包含另一个模板引擎是没有意义的。 我被权威地告知这会发生,但现在显然至少在 1.5 版本中不会发生。如有任何混淆,我们深表歉意。

    【讨论】:

    • 谢谢。现在我只需要获取一个很好的 JSON 示例和 ASP.NET Webforms 的 JQuery 模板。
    • 我的答案中的第一个链接应该有助于在 WebForms 环境中返回 JSON。然后,只需将 jQuery 模板替换为 jTemplates,这是一个相对容易的切换。你可以从这里开始了解它的具体语法:api.jquery.com/category/plugins/templates
    • jQuery 模板的另一个好处是用于填充模板的数据始终可以通过.tmplItem() 方法获得。如果jTemplates有类似的功能,我没见过。
    • 需要注意的是,jQuery 模板不再处于活跃开发中。它计划作为 jQuery UI 的新功能,但仍处于计划阶段。 github.com/jquery/jquery-tmpl
    猜你喜欢
    • 2014-09-06
    • 2010-09-19
    • 2014-07-26
    • 2019-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-30
    相关资源
    最近更新 更多