我正在尝试创建类似于 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>
提前致谢!