星期日, 5月 11, 2014

[jQuery] 常見的javascript樣版外掛

這篇記錄一下目前搜尋到的一些常用的javascript樣版引擎。 至於要選擇哪一種工具好像是見人見智,目前只有Linkedin所使用的dust.js有一些評估數據可以參考。

另外也有一個網址Template-Engine-Chooser列出了幾個選擇樣版的常見問題,透過這些問題他會給你一些你可參考的樣版語言有哪些xd


樣版的參考

jquery template


The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and will be superseded by JsRender.

JS Render


A lightweight but powerful templating engine, highly extensible, without DOM or jQuery dependency.

handlebars.js


Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. Mustache templates are compatible with Handlebars, so you can take a Mustache template, import it into Handlebars, and start taking advantage of the extra Handlebars features.

hogan.js

A compiler for the Mustache templating language

Mustache.js

Minimal templating with {{mustaches}} in JavaScript

Pure.js

Simple and ultra-fast templating tool to generate HTML from JSON data Keep your HTML clean of any logic Using JSON and Javascript only Works standalone or with dojo, DomAssistant, Ext JS, jQuery, Mootools, Prototype, Sizzle and Sly


Dust.js

linkedin使用的樣版,還有說明為何要使用此樣版。


  1. Leaving JSPs in the dust: moving LinkedIn to dust.js client-side templates
  2. The client-side templating throwdown: mustache, handlebars, dust.js, and more


Google Closure Templates

Closure Templates are a client- and server-side templating system that helps you dynamically build reusable HTML and UI elements. They have a simple syntax that is natural for programmers, and you can customize them to fit your application's needs. In contrast to traditional templating systems, in which you must create one monolithic template per page, you can think of Closure Templates as small components that you compose to form your user interface. You can also use the built-in message support to easily localize your applications. Closure Templates are implemented for both JavaScript and Java, so that you can use the same templates on both the server and client side. They use a data model and expression syntax that work for either language. For the client side, Closure Templates are precompiled into efficient JavaScript.


沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails