This a working example based on the previous posted workflow.
Feedback is as always welcome.
Original project repository: Instagram-PHP-API
The index file contains the Javascript which is responsible for loading new data and a bit of PHP which displays the first results. The script makes use of jQuery's DOM data storage, to store the latest max_id
.
This file represents the API which delivers additional images via pagination
.
It requires two GET
parameters:
tag
the tag name you used in your original request (index.php file)max_id
next max id
and returns a JSON object e.g.:
{
next_id: 1340220451361,
images: [
"http://distilleryimage7.s3.amazonaws.com/d53ffb38bafa11e181bd12313817987b_5.jpg",
"http://distilleryimage8.s3.amazonaws.com/647011aebaff11e188131231381b5c25_5.jpg",
"http://distilleryimage2.s3.amazonaws.com/7206772cbaff11e1b9f1123138140926_5.jpg",
...
]
}
Example AJAX call:
http://example.com/ajax.php?tag=kitty&max_id=1340220451361
Copyright (c) 2011-2012 - Programmed by Christian Metz
Released under the BSD License.
I set this up exactly and when clicking button I get nothing. No errors in console, paths and tokens are perfectly fine, ajax request seems to work, ajax.php seems to work when load directly with values replaced, but I just get nothing when pressing the button. If I add for example
$('#more').css('border','10px solid red');
insidesuccess: function(data) {
it works, but it just doesn't load up any images. Any hint how to get the images to load up?