0

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)
Siddharth Thevaril
  • 3,722
  • 3
  • 35
  • 71
Mr Vitch
  • 1
  • 3

1 Answers1

-1

Ok I find the solution. Just use the next event : 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;
    }
})
zengr
  • 38,346
  • 37
  • 130
  • 192
Mr Vitch
  • 1
  • 3
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/13999996) –  Oct 17 '16 at 00:22