我现在有像这样的HTML模块:
<div id="modal">
<div class="header_buttons"></div>
<p>
Are you sure you would like to perform <%= action_name %>
on <%= count %> objects?
</p>
<div class="footer_buttons">
<button>Do <%= action_name %></button>
</div>
</div>
我想通过解析这些内容_.template
$("#modal").html() //-> escapes `<%`
$("#modal").text() //-> doesn't escape, but doesn't include tags.
我的直接解决方案是每一个元素定位整个块代替,我可以使用text()
但我很好奇,如果有,否则这里是一个显而易见的解决方案?