Need help with Twitch tv project

I am stuck for hours and currently have no idea why the assignment of channel names as property to objects is not working,
see getjson section of my javascript section and review my code for channel name assignment to channels object.
my project link is
and i have made a tester version by clearing css and adding console log here
Thanks in advance.


First of all, you have the same error in different places in you code.

Lines 8, 16, 25, you wrote this var html=; Replace it by var html="";

Secondly, you don’t access the data object properties correctly.

The ajax returns an object. Here how you can run tests against it :

  • check if the stream property is not undefined. If it is, then the account is either closed or doesn’t exists. You can then check the status if you want.

  • If the stream property is not null, the fun can begin

  • returns the name of the channel

  • returns the logo of the channel

  • stream.viewers returns the current number of viewers

You are almost done. My advice is to search to know how is the data object structured. You can use an online json parser to help you see through.

Good luck.


Evntually figured these things myself,it is for the good i guess.
Thanks for giving such descriptive solution to my messy code.