這可能是一個愚蠢的問題,但我不習慣使用Ajax和JSON。我有一個數組標籤,我想從Instagram獲取media_counts。成功時,我想將收到的數據發送到一個php文件(並稍後保存到數據庫表)。我有這樣的代碼:
for (var i = 0; i < tags.length; i++) {
var tagname = tags[i];
var url = "https://api.instagram.com/v1/tags/" + tagname + "?client_id=" + clientID;
$.ajax({
type: "GET",
dataType: "jsonp",
cache: false,
url: url,
success: function (res) {
// Send res.data to php-file
}
});
}
你爲什麼不火'success'回調內的另一個Ajax請求Ajax請求? – trrrrrrm