JsRender: Declare template in script block, and render against data

HTML:


<script id="personTmpl" type="text/x-jsrender">
    <tr>
        <td>{{>firstName}}</td>
    </tr>
</script>


<table><tbody id="details"></tbody></table>

Data:

var person = {
    firstName: "Jeff"
};

Script:

// Render to string
var html = $( "#personTmpl" ).render( person );

// Insert as HTML
$( "#details" ).html( html );