gpt4 book ai didi

javascript - Uncaught ReferenceError : jsonFlickrFeed is not defined

转载 作者:行者123 更新时间:2023-11-30 14:40:45 26 4
gpt4 key购买 nike

我有以下要求:

const flickrApiPoint = "https://api.flickr.com/services/feeds/photos_public.gne";

try {

$.ajax({
url: flickrApiPoint,
dataType: 'jsonp',
data: { "format": "json" },
success: function (data) {
console.log(data); //formatted JSON data
}
});
}
catch (e) {
console.log(e);
}

但最后我得到了

Uncaught ReferenceError: jsonFlickrFeed is not defined
at photos_public.gne?&callback=jQuery331016421245174669186_1523107884637&format=json&_=1523107884638:1

我做错了什么,我该如何解决?提前致谢!

最佳答案

您的网址flickrApiPoint 不完整。它必须是 const flickrApiPoint = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";

完整示例:

const flickrApiPoint = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";

try {

$.ajax({
url: flickrApiPoint,
dataType: 'jsonp',
data: {format: "json"},
success: function (data) {
console.log(data); //formatted JSON data
}
});
}
catch (e) {
console.log(e);
}

关于javascript - Uncaught ReferenceError : jsonFlickrFeed is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49707931/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com