【发布时间】:2017-10-02 10:34:25
【问题描述】:
第一次加载我的页面时,表格生成如下(我迭代 blocks 作为请求的一部分传递):
<div class="container">
<table class="table table-striped">
<thead>
<tr>
<th>Index</th>
<th>Previous Hash</th>
<th>Timestamp</th>
<th>Data</th>
<th>Hash</th>
</tr>
</thead>
<tbody>
{% for block in blocks %}
<tr>
<th scope="row">{{block.index}}</th>
<td>{{block.previous_hash[0:10]}}</td>
<td>{{block.timestamp}}</td>
<td>{{block.data}}</td>
<td>{{block.hash[0:10]}}</td>
</tr>
{% else %}
<li><em>Unbelievable. No entries here so far</em>
{% endfor %}
</tbody>
</table>
</div>
现在我希望在不刷新 jquery 函数中的页面的情况下重新加载该表。我怎么做?
附: 我在更新文本字段等简单元素时没有问题:
$('#banner').text('new banner text')
但是这个表的东西很混乱。
【问题讨论】: