【发布时间】:2016-10-27 15:22:13
【问题描述】:
在 jekyll 中,这是可行的:
---
layout: default
---
<div class="brief">
<ul>
{% for post in site.posts %}
<li class="postlist">
<a href="#" onclick='document.getElementById("one").innerHTML="{{post.url}}";'>{{post.title}}</a>
<p>{{post.meta}} <br>{{post.date}} <br>{{post.category}}</p>
</li>
{% endfor %}
</ul>
</div>
<div class="post" id="one"></div>
但是当我将第 8 行更改为:
<a href="#" onclick='document.getElementById("one").innerHTML="{{post.content}}";'>{{post.title}}</a>
它坏了。为什么会发生这种情况,我该怎么做才能改变这种情况并获得预期的结果?
【问题讨论】:
-
您能否更具体地说明中断的具体内容?
标签: javascript html ruby jekyll