基于DOM树的JavaScript模板引擎 [英] DOM tree based JavaScript template engines

查看:134
本文介绍了基于DOM树的JavaScript模板引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个新的Javascript模板引擎来替代我的客户端模板需求的旧的jQuery模板。

I am looking for a new Javascript template engine to replace old jQuery Template for my client side templating needs.

我更喜欢模板引擎处理的方法DOM树而不是文本字符串,然后将煮熟字符串的内容转储到 innerHTML 中。这是更好的性能明智的,我发现DOM操作更适当地构建更多的DOM树。

I'd prefer approach where the template engine deals with DOM trees instead of text strings and later dumps the content of the cooked string into innerHTML. This is better performance wise and I find DOM manipulation more proper way of constructing more of DOM tree.

我对Javascript模板引擎有什么选择,它将直接创建DOM树而不是基于文本的引擎?我喜欢Mustache.js的无逻辑方法,但它似乎只在字符串上操作。本地jQuery集成也是一个很好的功能。

What options I do have for Javascript template engine which would directly create DOM trees instead of being text based engines? I like Mustache.js's logicless approach, but it seems to operate on strings only. Native jQuery integration would also be a nice feature.

推荐答案

透明度:

https://github.com/leonidas/transparency/

PURE:

http://beebole.com/pure/documentation/

https://github.com/flatiron/plates

为什么这样:

http://blog.nodejitsu.com/micro-templates-are-dead

这篇关于基于DOM树的JavaScript模板引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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