问题
There are two json calls and the call #2 is working. I don't have any idea about the first one (multiple streams).
(I know some of you would say: "go and read the docs right there", but it didn't help me very much. https://github.com/justintv/Twitch-API/blob/master/v2_resources/streams.md)
Call #1:
$.getJSON("h ttps://api.twitch.tv/kraken/streams?channel=viagamehs,starladder1.json?callback=", function(response){
response = JSON.stringify(response);
OBjonline = jQuery.parseJSON(response);
alert(response);
});
Call #2:
$.getJSON("h ttps://api.twitch.tv/kraken/streams/viagamehs_ru.json?callback=?", function(response){
response = JSON.stringify(response);
OBjonline = jQuery.parseJSON(response);
alert(response);
});
回答1:
The right code:
$.getJSON("https://api.twitch.tv/kraken/streams.json?channel=viagamehs,starladder1&callback=?", function(response){
response = JSON.stringify(response);
console.log(response);
});
来源:https://stackoverflow.com/questions/30548486/get-multiple-streams-json-data-from-twitch-api