$(function() {
$.ajax({
type: "GET",
dataType: "jsonp",
cache: false,
url: "https://api.instagram.com/v1/users/self/media/recent/?access_token=",
success: function(data) {
for (var i = 0; i < 20; i++) {
$("#pics").append("<a target='_blank' href='" + data.data[i].link + "'><img src='" + data.data[i].images.low_resolution.url + "'></img></a>");
$("#text").append("<p>"+data.data[i].caption.text+"</p>");
}
}
});
});
上午试图让Instagram的饲料API,代码工作正常,但我有错误TypeError: data.data[i].caption is null
,饲料文本没有显示所有我得到的只有3形式20 json中的元素。类型错误:data.data [I] .caption是空的Instagram API
请分享API响应 – brk
检查链接API,我把http://jsoneditoronline.org/?id=17c05e938eeb42d37c330b814432e300 @brk –