Hi everyone,
I am working on the twitch challenge for 4 days now and I have been stack in one part for the last 3. Particularly, I am getting the “No client id” response error 400 every time I am clicking on a link. 90% of the people who asked for help in this forum was for the same question, but it is very confusing what every person has done and I can’t come up with a solution through other peoples questions. If anyone can take a look on the code and give me a clue where the problem is lying it will be much appreciated!
Thank you!
Here is the code:
function loadAll(){
channels.forEach(function(channel){
$.ajax({
type: 'GET',
url: test_url+channel+'?client_id='+clientID+'?callback=?',
headers:{
'Client-ID': clientID
}, success: function(data){
if(data.stream===null && data._links!==null){
html += "<div class='off'><div class='row' id='containt'><img src='#' id='icon'/><h4 id='text'>"+channel+": <a href='"+data._links.channel+"' id='link_offline'>Offline</a></h4></div></div>";
$(".channels_collection").html(html);
} else if(data.status==='404'){
html += "<div class='off'><div class='row' id='containt'><img src='#' id='icon'/><h4 id='text'>"+channel+": <a href='#' id='link_closed'>Account doesn't exist!</a></h4></div></div>";
$(".channels_collection").html(html);
} else {
html += "<div class='on'><div class='row' id='containt'><img src='"+data.stream.channel.logo+"' id='icon'/><h4 id='text'>"+channel+": <a href='"+data._links.channel+"' id='link_online'>"+data._links.channel+"</a></h4><p id='details'>"+data.stream.game+" - Views: "+data.stream.channel.views+" - Followers: "+data.stream.channel.followers+"</p></div></div>";
$(".channels_collection").html(html);
}
}
});
});
}