G
G
Gabe Jonson2015-11-27 15:37:14
JavaScript
Gabe Jonson, 2015-11-27 15:37:14

How to display not the whole array, but a part?

Good afternoon, there is a file: array.json, it contains 100500 objects. When this document is requested, all 100500 items are displayed.
And then a logical question arose: how to display not 100500 elements on the page, but 100, and then another 100 when clicking, and another 100 when the next click.
I tried to write something like a condition on the length of the array, but! didn't work...
A real example, like a contact wall, only there the loading goes to the very end when scrolling.
Well, or like in online stores, at the bottom there is a button for 20 more elements ...
Or at least what this thing is called to find an example and figure it out.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Pavlov, 2015-11-27
@dmitry_pavlov

If you can change the server logic - add parameters to the request - from which record to return data - pagination is called. Well, then get JSON data in portions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question