【发布时间】:2014-02-23 19:42:24
【问题描述】:
我正在尝试使用 $.getJSON 将值列表存储在数组中,但不知何故它无法解决数组在 console.log 中显示未定义
这是我的 getJSON 代码
jQuery.getJSON(List6.attractionimg, function(rf){
jQuery.each(rf, function(index, file){
attractionImgLinks.push(file.url);
});
URL“List6.attractionimg”给出的 JSON 代码
{"files":[{"name":"2013-11-17_183243.png","size":7975,"url":"http:\/\/example.com\/demo\/wp-content\/uploads\/rform\/attractionimg\/user5307eb38362d4\/2013-11-17_183243.png","thumbnailUrl":"http:\/\/example.com\/demo\/wp-content\/uploads\/rform\/attractionimg\/user5307eb38362d4\/thumbnail\/2013-11-17_183243.png","deleteUrl":"http:\/\/example.com\/demo\/wp-content\/themes\/driskill\/rform\/files\/attractionimg\/?file=2013-11-17_183243.png","deleteType":"DELETE"}]}
我在这段代码之外声明数组是这里的问题吗?
【问题讨论】: