JSFiddle - React, Tailwind, and code Playground
by danheberden
HTML
<script src="https://github.com/jquery/jquery-tmpl/raw/master/jquery.tmpl.js"></script>
<ul id="output"></ul>
JavaScript
var content = [
{ Name: "Test 1", Other: "1000" },
{ Name: "Test 2", Other: "2000" },
{ Name: "Test 3", Other: "3000" }
];
window.test = (function() {
var count = 0;
return function() { return count++; };
})();
var markup = "<li><b>${Name}</b> (${Other}) - ${ test() } </li>";
$.template( "temp", markup );
$.tmpl( "temp", content )
.appendTo( "#output" );