I got a little stuck on how I can get all the data from the jsonp api when the data is paginated. The callback is as follows:
{
entries: [],
page: 1,
pages: 101,
posts: 10054
}
only the code only gets the results from page 1, but I would like to get the results from all 101 pages. If I add a request to a URL, for example: &page=2or &page=3, I can access objects only from this page, I try to access all objects from all pages at a time .... I would appreciate help :)
$.getJSON('http://hotell.difi.no/api/jsonp/mattilsynet/smilefjes/tilsyn?callback=?', function(data){
var html = "";
$.each(data.entries, function(key,value){
html += '<p>' + value.navn + '</p>';
})
$('#test').html(html);
})
source
share