SO jQuery Fiddle
Test Fiddle mainly for SO Questions jQuery 1.4.3, UI 1.8.5
by Nick Craver
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/ui-lightness/jquery-ui.css">
<script src="http://github.com/jquery/jquery-tmpl/raw/master/jquery.tmpl.js"></script>
<script id="bookTmpl" type="text/x-jquery-tmpl">
<li>
${title} by ${author}<br />
Rating: ${rating} -> ${this.getName()}
</li>
</script>
<div id="test"></div>
JavaScript
function showBooks(data) {
$("#bookTmpl").tmpl(data, {
getName: function() {
return 'bla';
}
}).appendTo( "#test" );
}
showBooks([{
title: "title here",
author: "author here",
rating: "rating here",
}]);