xJson a super-simple templating engine that is fast, tiny (less than 2kB when compressed) and easy to use.
xJson can 'Read' and 'Write' JSON data throught your usual HTML tags by using data-attributes paradigm.
data-value: set HTML tag's value/text with JSON object's property
data-class: set HTML tag's class with JSON object's property
data-attr: set HTML tag's attributes with JSON object's property
xJson.Write: Bind data into HTML tags
xJson.Read: Read data from HTML tags
<div id="view" data-class="sex">
<label data-value="first" data-attr="title" data-attr-value="email" ></label>
<b data-value="lastname"></b><br />
</div>
{ firstname: 'Elon', lastname: 'Musk' }
[
{ firstname: 'Elon', lastname: 'Musk' },
{ firstname: 'Jeff', lastname: 'Bezos' },
{ firstname: 'Jack', lastname: 'Ma' }
]
Return: $clone (of $template if the latter is specified) or $target
Return: data (json format)