簡體   English   中英

jQuery模板引擎:無法呈現html輸出

[英]jQuery templating Engine : Not able to render html output

我的模板是:

 <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} }}

請找到輸出為 在此處輸入圖片說明 答案將不勝感激..謝謝

嘗試:

<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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM