View on GitHub

Jquery.lightdatabind

simple enough (in few KBs code) Data binding based on jQuery

Download this project as a .zip file Download this project as a tar.gz file

jQuery.lightDataBind

Bind your JSON Data in one line code.

& The rest is all standard HTML attribute writing.

NO MORE WEIRED TEMPLATE TAGS

like this: <script type="template/text"><div>{{data?}}</div></script>

How to use it:

HTML Part

<div id="resultHtml" class="clearfix well well-small">
    <img data-src="img" class=" pull-left">
    <h3><a data-text="title" data-href="url"></a></h3>
    <div data-html="content"> </div>
</div>

Javascript Part

var data = {
    img:"https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/bootcamp/octocat_setup.png",
    url:"http://github.com/",
    title:"This is a title with a href attribute. ",
    content:"Some HTML content with <strong>HTML Tag</strong> support."
};
$("#resultHtml").ldatabind(data);

Result Display

This is a title with a href attribute.

Some HTML content with HTML Tag support.

Attributes can be used:

TO DOs

I HAVE NO IDEA