Search code examples
jqueryjsonjtemplates

How to display the linebreak in jTemplate


I am using jTemplates 0.7.8 to populate data into a template htm file.

The only problem is my json data contains some html tags. Say,

{'address':'123 Peter St. <br />city, state, zip', ...}

In the template {$T.record.Address} does not render
as a line break but instead output the literal.

What can we do about this?


Solution

  • Now I found the solution:

    Change

    $('#Container').setTemplateURL("/Templates/MyTemplate.htm");
    

    into:

    $('#Container').setTemplateURL("/Templates/MyTemplate.htm", null, { filter_data: false });