jquery-ias : page with some php variable?

时间:2016-10-15 17:05:28

标签: php jquery-ias

I've a got a "strange problem" with Jquery-IAS (http://infiniteajaxscroll.com/).

Everything is ok when I use a simple page like index.php for example but when I use a variable like index.php?variable=foo to filter my query with only "foo" values in my database (using PDO prepare to have the $_GET result), Jquery-IAS doesn't work anymore (infinite loading).

I read the support on the website but I couldn't find the answer. I think the "load method" will be the answer but it isn't.

Any idea ?

Edit: this is the error on console when I do the first scroll:

jquery.min.js:4 GET http://localhost/ch/index.php 404 (Not Found)

1 个答案:

答案 0 :(得分:-1)

好的,我找到了解决方案。 只需使用next事件:http://infiniteajaxscroll.com/docs/events.html#next

即可
  

应加载下一页时触发。在加载之前发生   下一页开始。

     

通过此事件,可以取消下一页的加载。   您可以通过从回调中返回false来执行此操作。

     

如果您点击某个网址,请假设您要停止加载更多网页:

ias.on('next', function(url) {
    if (url.match(/page3\.html/)) {
        return false;
    }
})