jQuery plugins-2: icanhaz

The second part of useful jQuery plugins is icanhaz.

icanhaz: Icanhaz simple and powerful client-side templating.
Example: template part



{{shape}}
{{color}}


Example: main part












Shape Color


jQuery(document).ready(function() {
var dynamicContentObject = { };
var result;
$.ajax({
type: "GET",
dataType: "json",
url: "samplePopulate.php",
async:false,
success: function( data ) {
result= data;
}
});

dynamicContentObject['shape'] = result.shape;
dynamicContentObject['color'] = result.color;

var line = ich.sampleLine(dynamicContentObject);
$("tbody#itemContainer").append(line);
});

It would be before clicking Populate button:

After clicking Populate button, it would look like:

icanhaz website is: icanhaz
Advertisements