Load more with AJAX with offset


#1

Hi everyone. I’m trying to recreate this cookbook recipe, load more with Ajax, but I’m having some problems:

  1. The JSON only returns the first four articles after the offset, with the ‘more’ variable set to false, but there are many more articles.
  2. The articles that are loaded are the same as the last few already shown on the homepage.

This is my homepage template with the controller and article snippet. The first page of the homepage uses the same snippet. This is the Javascript and this is the home.json.php with its output as a screenshot to make it a little bit more readable.

What am I doing wrong? I do realize that the setup for the articles on the homepage is strange, the reason is that for the first bit of the page, there are some other bits of contents mixed in. For a live example, check out davlstudio.com.

Any help would be greatly appreciated!


#2

You url is not correct, it should be /.jsonwithout home.


#3

Thank you for the reply! This works, too. Same result, however. I guess url.com/home.json just redirects to url.com/.json anyway.


#4

Hm, I can’t see anything obviously wrong, but can’t test this without a similar project, either. Could you maybe provide a stripped down version of the project, if you haven’t sorted it out yet?


#5

Does this help? It has everything except the content, which I can also send you if you need!