Hey guys, I’ve been working on my Twitch.tv project. For some reason my getJSON call fails. I know it fails but I don’t know why. Could you guys help me with this? but more importantly, for the future, how can I debug getJSON calls? how can I know why they’re not working?
Heres my code:
$(document).ready(function(){
var url = "https://wind-bow.gomix.me/twitch-api/streams/freecodecamp";
$.getJSON(url, function(d) {
console.log("success");
}).done(function(d) {
console.log("done");
}).fail(function(d) {
console.log("error");
console.log(url);
}).always(function(d) {
console.log("complete");
});
});
Console logs: “error” and then “complete”. Thanks in advance.