I am currently working myself throught the Load more with ajax example but I want to use it on a my default page aka the homepage as a microblog.
Everything works well, except that the json file is not read correctly. I use the correct classname for the data source but I cant figure out how to decode the JSON File.
When I log it it gives me an empty .JSON and or a home.
What am I missing?
Many thanks in advance
Sure, the structure is a little different and the blog entries are sections. Ssection contains the sections which all seems to work well imitially, e.g. when I change the limit value the according number of entries is rendered with the according content.
The javascript works except the $.get() which is not entered since the var url = element.data('page') + '.json'; obviously results in an empty string or in a"home" when I resolve the url but never in a default.json.php (which is expected?) . I guess at this point I am missing something.
The problem seems to be that the home page redirects to /. So maybe content representations don’t work here, at least I can’t get it to work, @lukasbestle?
Alternative: Do it without content representations.
Thanks, the url is correct now but the $.get() request is not working and nothing is happening, when I click the button. I am wondering if it works with this type of url and will try $.ajax() to get the error.
Did exactly like this and got 404 regarding http://localhost:4000/.json?limit=1&offset=1
And how is this topic solved when @carstenh 's last reply was an error 404?
Probably because he liked the last answer which was then regarded as solving the problem.
Edit: Without your file structure and the actually used code it’s impossible to tell what’s going wrong, as the example did and does work in my test installation.
Hey there. @daybugging Funny thing for me was, on development it just didn’t work, but on live server just as expected.
Only problem for me is the following:
The button only hides after all content is loaded, but I’d like it to do something upon reaching the last item, so 5 left, I click “load-more” button, everything loads & when I scroll down, past the last item, the button has changed / is hidden.