jQuery 模板引擎

标签 jquery templates

根据this question 、什么是 jQuery 模板引擎?

使用它们有什么好处和优势?

最佳答案

根据这篇文章:http://weblogs.asp.net/scottgu/archive/2010/05/07/jquery-templates-and-data-linking-and-microsoft-contributing-to-jquery.aspx

Client-side templates enable jQuery developers to easily generate and render HTML UI on the client. Templates support a simple syntax that enables either developers or designers to declaratively specify the HTML they want to generate. Developers can then programmatically invoke the templates on the client, and pass JavaScript objects to them to make the content rendered completely data driven. These JavaScript objects can optionally be based on data retrieved from a server.

使用它们的好处是您可以将逻辑(主 UI 和控件)与代码重用分开。在我看来,后者是更大的优势。至于缺点,嗯……也许是学习曲线?还是多余的空闲时间?两者都是固有的缺点(如果你不喜欢高效的话)

关于jQuery 模板引擎,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5655645/

相关文章:

c++ - 推断/删除模板模板参数的类型

templates - Azure 数据工厂 V2 : auto-start trigger upon deployment?

jquery - 使用 jQuery 隐藏跨度

javascript - $digest 在 $watch 定义触发 "$apply already in progress..."错误后不久

javascript - 谷歌使用的滚动条

jquery - 动画滚动以锚定在页面上

c++ - 如何删除可变参数模板构造函数的复制/移动实例化

c++ - 从函数模板参数自动推断对容器的元素类型

c++ - 类模板特化内部的静态成员函数

javascript - Requirejs:AMD 模块未定义