JsRender Demos

Template context: Passing in additional variables to a render() call

Passing in contextual variables or helper functions, using the options parameter of ...render( data, options );
$( selector ).render( data, {
    reverseSort: reverse,
    buttonCaption: reverse ? "Sort increasing" : "Sort decreasing",
    format: myFormatFunction
})
Use ~name to context variables or helpers by name - whether passed in with options,
registered globally as helpers, or registered as helpers for a specific template.
<th><button>{{>~buttonCaption}}</button></th>
...
<td>{{>~format(title)}}</td>
...
<td>{{sort languages reverse=~reverseSort}}...{{/sort}}</td>