使用 js 生成模板读取 json 中的内容的时候读取不出来

2017-02-10 13:29:34 +08:00
 hardman
'#{% for items in comments %}',
'#{% if loop.index > 2 %}',
'#{% break %}',
'#{% endif %}',
'<li>',
'<a class="_4zhc5 _iqaka" title="#{items.username}" href="/profile/#{items.user_id }"
'#{items.username}',
'</a>',
'<span>',
'<span>',
'#{items.content}',
'</span>',
'</span>',
' </li>',
'#{% endfor %}',
1704 次点击
所在节点    Python
1 条回复
hardman
2017-02-10 13:31:06 +08:00
{
"has_next": true,
"images": [
{
"head_url": "http://images.nowcoder.com/head/710m.png",
"comment_count": 3,
"user_id": 100,
"created_date": "2017-01-19 14:22:51",
"url": "http://images.nowcoder.com/head/603m.png",
"user_name": "User100",
"id": 994,
"comments": [
{
"username": "User100",
"content": "This is a comment0",
"user_id": 100
},
{
"username": "User100",
"content": "This is a comment1",
"user_id": 100
}
]
},
{
"head_url": "http://images.nowcoder.com/head/710m.png",
"comment_count": 3,
"user_id": 100,
"created_date": "2017-01-19 14:22:51",
"url": "http://images.nowcoder.com/head/972m.png",
"user_name": "User100",
"id": 993,
"comments": [
{
"username": "User100",
"content": "This is a comment0",
"user_id": 100
},
{
"username": "User100",
"content": "This is a comment1",
"user_id": 100
}
]
},
{
"head_url": "http://images.nowcoder.com/head/710m.png",
"comment_count": 3,
"user_id": 100,
"created_date": "2017-01-19 14:22:51",
"url": "http://images.nowcoder.com/head/151m.png",
"user_name": "User100",
"id": 992,
"comments": [
{
"username": "User100",
"content": "This is a comment0",
"user_id": 100
},
{
"username": "User100",
"content": "This is a comment1",
"user_id": 100
}
]
}
]
}

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/339545

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX