Twitch---Why my code doesn't work?


Hi, I need help with twitch tv. What is wrong ?


You have some string concatenation issues, as highlighted by the codepen editor. I’m guessing those are new errors since you posted this question, but if you’re having trouble fixing those, you may want to do a refresher on some of the earlier challenges, such as Word Blanks:

I find Template Literals to be really helpful when concatenating strings + variables. They aren’t part of the Free Code Camp map, but maybe study those when you get a chance to see if they help:

Once you fix the strings, you will hit some CORS errors. You can work around those the same way you did in your Weather App with the Dark Sky API with callback=?, or by changing the URL to use the new server name instead of


I’m seeing a lot of little errors. You need to click on the little red exclamation point in the lower right corner and find the errors. When I click it it shows me an error (“unexpected string”) on line 18:

    $('#twitch').append(<'div class = "row text-left">' + ch.message +'</div>');

I think it is the first “<” in append, it needs to be inside the string, in other words

    $('#twitch').append('<div class = "row text-left">' + ch.message +'</div>');

Then on line 30, “unexpected token ‘)’”:

        $.("#online").append("<div class = "row text-left"><img class= "image" src = " + logo + "><a href = "+ link + "target="_blank">" + id +

It is getting confused by the period after the $ - it shouldn’t be there. When I fix that I get “unexpected identifier” - the problem is that you are using double quotes inside a double quote surrounded string. You can’t do that.

So far it’s just a lot of little errors. You need to work through them to get to the big issues.

Really, I think you should test more often. If this many errors are piling up, it says to me that you aren’t testing as you go.

Additionally, you need to indent and organize your code better to make it more readable. If all else fails, if you select all your code and to a shft-tab, most code editors will do a decent job auto-indenting, but you really should be doing this as you go, as this is part of the thought process.