Twitch tv app - help

Hi friends, I need help regarding my twitch tv app. It is almost finished, I am facing one problem though. I can figure out how to clear the result div so that I could load new data in it. For example, all channels load when the page loads. but when you click on offline or online, the result loads under already loaded result. I want to clear old (All) result and load which ever button is clicked. Can someone guide me to correct direction. On every click on any tab, results keep on adding under already populated results.

regards,
Sachin Gairola

it’s a little difficult to see all your code to detect your problem but I have an idea that can help you personally I use it often.
the idea is to resume your solution in your favorite editor (sublime text), execute your solution in your favorite browser finally debug (execution step by step) your solution this way you can follow the course of your logic. do not forget to also use console.log to see the contents of your variables.
I hope this will help you.

Thanx zina for the suggestion, I also do my project same way. I developed this app in the atom and only after that I post it here. App is working fine functionality wise, the only problem I’m facing is that I can’t clear old (All) result from div to populate new (online/offline)results in div. I tried doing .html(" ") .remove() but it doesn’t work.

You don’t need to make an api call for each status “all/online/offline”. You can make only one call for all channels and apply a class="online" for channels that are online and a class="offiline" for those that are offline then filter by class to show/hide specific chanells.

thanks sorinr,
Your suggestion helped and it was much easier than what I was trying. Cheers…