jquery-ias:页面有一些 php 变量?
jquery-ias : page with some php variable?
我有一个 "strange problem" 和 Jquery-IAS (http://infiniteajaxscroll.com/)。
当我使用像 index.php
这样的简单页面时一切正常,但是当我使用像 index.php?variable=foo
这样的变量来过滤我的查询时,我的数据库中只有 "foo"
值(使用 PDO 准备得到 $_GET
结果),Jquery-IAS 不再工作(无限加载)。
我read 网站上的支持,但找不到答案。我认为 "load method" 将是答案,但事实并非如此。
有什么想法吗?
编辑:这是我第一次滚动时控制台上的错误:
jquery.min.js:4 GET http://localhost/ch/index.php 404 (Not Found)
好的,我找到了解决方案。
只需使用 next
事件:http://infiniteajaxscroll.com/docs/events.html#next
Triggered when the next page should be loaded. Happens before loading
of the next page starts.
With this event it is possible to cancel the loading of the next page.
You can do this by returning false from your callback.
Say you want to stop loading more pages if you hit a certain url:
ias.on('next', function(url) {
if (url.match(/page3\.html/)) {
return false;
}
})
我有一个 "strange problem" 和 Jquery-IAS (http://infiniteajaxscroll.com/)。
当我使用像 index.php
这样的简单页面时一切正常,但是当我使用像 index.php?variable=foo
这样的变量来过滤我的查询时,我的数据库中只有 "foo"
值(使用 PDO 准备得到 $_GET
结果),Jquery-IAS 不再工作(无限加载)。
我read 网站上的支持,但找不到答案。我认为 "load method" 将是答案,但事实并非如此。
有什么想法吗?
编辑:这是我第一次滚动时控制台上的错误:
jquery.min.js:4 GET http://localhost/ch/index.php 404 (Not Found)
好的,我找到了解决方案。
只需使用 next
事件:http://infiniteajaxscroll.com/docs/events.html#next
Triggered when the next page should be loaded. Happens before loading of the next page starts.
With this event it is possible to cancel the loading of the next page. You can do this by returning false from your callback.
Say you want to stop loading more pages if you hit a certain url:
ias.on('next', function(url) {
if (url.match(/page3\.html/)) {
return false;
}
})