$(document).ready(function(){
var paramter = "https://www.instagram.com/nike/media/&callback=?";
console.log(paramter);
$.getJSON(paramter ,function(json)
{
var birdpic = " ";
var data = json.items;
birdpic +="<div class='pics'><img src='"+data[0].images.low_resolution.url+" '></div>";
$("<div/>").appendTo("#picture").append(birdpic);
});
});
所以,我尝试将回调添加到结尾https://www.instagram.com/nike/media/q=callback
这是正确的格式
现在,我正在
jquery-3.1.0.js:9471
GEThttps://www.instagram.com/nike/media/&callback=jQuery31007809933559544142_1478278811621?_=1478278811622
send @ jquery-3.1.0.js:9471ajax
@ jquery-3.1.0.js:8999jQuery.(anonymous function)
@ jquery-3.1.0.js:9148getJSON
@ jquery-3.1.0.js:9129(anonymous function)
@ bird.js:5mightThrow @ jquery-3.1.0.js:3508process @ jquery-3.1.0.js:3576
答案 0 :(得分:0)
更改此行:
var paramter = "https://www.instagram.com/nike/media/";
到这一行:
var paramter = "https://www.instagram.com/nike/media/&callback=?";
答案 1 :(得分:0)
您使用的API是未记录的API,并且它不支持JSONP(回调),因此您必须在后端进行调用,您不能使用browser / javascript来进行API调用。
如果您使用文档化的API,它们都支持JSONP,您可以使用ajax从前端代码访问