$(document).ready(function () { var output = $("#output"); var template = $("#test2").html(); var data2 = [1, "two", new Date(), 3 + 1, true]; html = Mustache.render(template, data2); output.append(html); });
<h2>Example 2 : anonymous data array of items</h2> <div id="output"></div> <script type="text/html" id="test2"> {{#.}} <p>{{.}}</p> {{/.}} </script>