【发布时间】:2014-06-01 14:54:31
【问题描述】:
我正在尝试使用 Jquery 模板循环从 Json 下面呈现值,但没有从 Json 中获取任何值。下面是我的 Json:
{
"CommentListClass":[
{
"Author":"Attis1",
"CommentText":"Really goo"
},
{
"Author":"joshar1",
"CommentText":"My picture"
},
}
我的 Jquery 模板是:
<script type="text/x-jsrender" id="tempRecentComments">
{{for List}}
<div class="item">
<div class="item-content">
<h3>{{:CommentListClass.Author}}</h3>
</div>
</div>
{{/for}}
</script>
【问题讨论】:
-
看起来您使用的是 JsRender,而不是 jQuery 模板。您可以更改标题/文本这样说,并用 jsrender 过滤器替换您的 jquery-templates 过滤器吗?
标签: javascript jquery json templates jquery-templates