Transparency – A Minimal Template Engine For jQuery

Transparency is a minimal template engine for jQuery. It really helps to make HTML code parts from JSON. It maps JSON objects to DOM elements with zero configuration. It is as easy as just call .render().

Features

  • Semantic data binding – No <%=foo%> or {{foo}} assignments polluting the HTML
  • Collection rendering – No need for hand-written loops in the HTML
  • Valid HTML templates – Write templates as a part of the HTML, in plain HTML. Use any HTML editor you like
  • Plain JavaScript logic – All the power without learning yet another micro programming language
  • Blazing fast – Templates are cached and optimized automatically
Transparency is compatible with IE9+, Chrome, Firefox, iOS, Android and other mobile browsers. Support for older IE browsers requires jQuery.
.

var hello;

hello = {
  hello: "Hello!",
  hi: "<i>Hi there!</i>",
  span: "Goodbye!"
};

$('.container').render(hello);
Will Give You
<div>
  <div id="hello"></div>
  <div></div>
  <span></span>
</div>

Install

Get the compiled and minified version and include it to your application. jQuery is optional, but if you happen to use it, Transparency registers itself as a plugin.

Browser

<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/transparency.min.js"></script>
Enhanced by Zemanta

Leave a Reply