【发布时间】:2017-03-27 16:41:33
【问题描述】:
我正在尝试在我的项目中使用无限 ajax 滚动插件。我只是关注了官方网站并包含了必要的 javascript 文件。以下是我的代码:
<div class="row">
<div class="col-lg-4">
<div class="bootstrap-card">
<img src="{% static 'images/1.jpg' %}" class="img-responsive img-rounded" alt="card imag">
<div class="overlay">
<a class="info" href="#">View Details</a>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="bootstrap-card">
<img src="{% static 'images/1.jpg' %}" class="img-responsive img-rounded" alt="card imag">
<div class="overlay">
<a class="info" href="#">View Details</a>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="bootstrap-card">
<img src="{% static 'images/1.jpg' %}" class="img-responsive img-rounded" alt="card imag">
<div class="overlay">
<a class="info" href="#">View Details</a>
</div>
</div>
</div>
</div>
<script src="{% static 'hw1/js/callback.js' %}"></script>
<script src="{% static 'hw1/js/jquery-ias.min.js' %}"></script>
<div id="pagination">
<a href="page2.html" class="next">next</a>
</div>
<script>
$(document).ready(function() {
var ias = jQuery.ias({
container: '.row',
item: '.col-lg-4',
pagination: '#pagination',
next: '.next',
delay: 1250
});
});
ias.extension(new IASSpinnerExtension());
ias.extension(new IASTriggerExtension({offset: 2}));
ias.extension(new IASNoneLeftExtension({text: "You reached the end"}));
</script>
所以这里 page2.html 是另一个页面,它确实存在。
那么有谁知道错误信息的原因:
(index):244 Uncaught ReferenceError: ias is not defined(...)(anonymous function) @ (index):244 jquery-3.1.1.min.js:2 jQuery.Deferred 异常:jQuery.ias 不是函数 TypeError:jQuery.ias 不是函数 在 HTML 文档。 (http://localhost:8000/:235:24) 在 j (http://localhost:8000/static/hw1/js/jquery-3.1.1.min.js:2:29948) 在 k (http://localhost:8000/static/hw1/js/jquery-3.1.1.min.js:2:30262) 未定义
【问题讨论】:
标签: javascript jquery django infinite-scroll jquery-ias