jTemplates: html in variables

烈酒焚心 提交于 2019-12-23 15:42:43

问题


I'd like to include some html in a jTemplate variable - e.g.

<td class="numeric">{$T.total_price}</td>

Where total_price is:

"$12<span>.00</span>"

Is there any way I can get the span to show up as html?


回答1:


I got it with:

$('#mhid')setTemplate(s, [], {filter_data: false});



回答2:


I am having the same problem:

Template:

   <textarea id="pagination" style="display:none"><b>pagination</b></textarea>

If I call the template as:

$('').setTemplate($('pagination').html(),[],{filter_data: false});

$('').processTemplate();

Its not working. its displaying as:

<b>pagination</b>

If I call the same template by using setTemplateElement like:

$('').setTemplateElement('pagination');

$('').processTemplate();

Its working. its displaying as: pagination



来源:https://stackoverflow.com/questions/1721603/jtemplates-html-in-variables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!