I return an JSON array from PHP file with 200 ID's. (ID : number). I would like to just have 18 of theese ID's so that i send only 18 ID's to a new PHP file, then after 2 seconds, i would like to send the next 18 ID's of the JSON to the new PHP file as well, until there are no more ID's in the JSON array to send.
$.get('get.php?randomize=1', function(data) {
var json = data;
$("#wallpaper").load('get_random.php?json_18=' + encodeURI(data), hideLoader());
});
As you see, i have stored the JSON in a variable called json. But i dont know how to split it up for each 18 ID's. I have read about .each function in jQuery, but i don't understand it well. I was hoping someone could help me.
get.php?randomize=1&offset=0&numResults=18. Your offset would increment each time, returning the next 18, and so on.