根据this question 、什么是 jQuery 模板引擎?
使用它们有什么好处和优势?
最佳答案
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/