【发布时间】:2014-02-19 11:00:41
【问题描述】:
我的 JSON 响应是这样的:
{
"description": "discription about the feaure will come here. <a href=\"http://example.com\" target=\"_blank\">Learn more</a>",
"largeIconURL": "some_path/ico_someicon.gif",
"displayName": "feature one"
},
{
"description": "discription about the feaure will come here.",
"largeIconURL": "some_path/ico_someicon.gif",
"displayName": "feature two"
},
{
"description": "discription about the feaure will come here. ",
"largeIconURL": "some_path/ico_someicon.gif",
"displayName": "feature three"
},
我的模板是这样的
<%
_.each(items,function(item, key, list){
%>
<li>
<div class="oneSpec">
<div class="description">
<h4><%= item.displayName %></h4>
<p><%= item.description %></p>
</div>
</div>
</li>
<%
});
%>
如何在将 description 节点绘制到 DOM 之前删除锚标记
【问题讨论】:
-
要去掉description绝对不写!
标签: javascript underscore.js underscore.js-templating