我正在尝试创建类似于twitter / facebook / google文档的无限滚动。我已经研究了很多插件和教程,但我似乎无法弄清楚如何做到这一点。似乎我所看到的一切都是通过ajax加载另一个页面,而不是只从数据库中提取一部分内容。
<div class="question">
{% if the_question %}
<ul>
<li>
<div class="votecounter">
<span class="score" id="linkscore{{ question_id }}"
title="after {{ score.num_votes|default:0 }} vote{{ score.num_votes|default:0|pluralize }}">
{{ score.score|default:0 }}
</span>
</div>
<div class="votearrowdiv">
<form class="linkvote" id="linkup{{ question.id }}" action="/home/{{ question.id }}/{% if vote and vote.is_upvote %}clear{% else %}up{% endif %}/vote/" method="POST">
{% csrf_token %}
<input type="image" id="linkuparrow{{ question.id }}" class="{% if vote and vote.is_upvote %}uparrowBlue{% else %}uparrow{% endif %}" value=""></input>
</form>
<form class="linkvote" id="linkdown{{ question.id }}" action="/home/{{ question.id }}/{% if vote and vote.is_downvote %}clear{% else %}down{% endif %}/vote/" method="POST">
{% csrf_token %}
<input type="image" id="linkdownarrow{{ question.id }}" class="{% if vote and vote.is_downvote %}downarrowBlue{% else %}downarrow{% endif %}" value=""></input>
</form>
</div>
<div class="actualQuestion">
<a href="/home/{{ content.id }}/{{ question.id }}/">{{ question.question_text }}</a>
</div>
</li>
</ul>
</div>
提前致谢!