【问题标题】:jQuery templating Engine : Not able to render html outputjQuery模板引擎:无法呈现html输出
【发布时间】:2014-02-11 12:21:58
【问题描述】:

我的模板是:

<script id="tmplRiskInformation" type="text/x-jquery-tmpl">
    <div class="">
        {{tmpl(collection) "#tmplLimitsDeductible" }} 
    </div>

</script>
<script id="tmplLimitsDeductible" type="text/x-jquery-tmpl">
    <div>
        ${LimitsDeductible} 
    </div>

</script>

输出是来自数据库的 html,而不是呈现给浏览器。该值是一个html表格

LimitsDeductible = "<table><tr><td>TEST TEST</td></tr></table>"

我使用了以下内容,但没有得到文本而不是 html 的结果。

${html LimitsDeductible} 
{{html ${LimitsDeductible} }}

请找到输出为 答案将不胜感激.. 谢谢

【问题讨论】:

    标签: jquery ajax templates


    【解决方案1】:

    试试:

    <script id="tmplLimitsDeductible" type="text/x-jquery-tmpl">
      <div>
        {{html LimitsDeductible}}
      </div> 
    </script>
    

    查看示例:https://github.com/BorisMoore/jquery-tmpl/blob/master/demos/step-by-step/0_tmpl-read-only/2_html-tag-source.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多