Hi Everyone,
First off, I cannot thank everyone enough for all the help and feedback during my journey with FCC. Below is the link to my Twitch tv project. I would like to get some feedback. Any and all feedback is welcomed.
Thank you in advance!
Hi Everyone,
First off, I cannot thank everyone enough for all the help and feedback during my journey with FCC. Below is the link to my Twitch tv project. I would like to get some feedback. Any and all feedback is welcomed.
Thank you in advance!
What I like:
Great work in completing the challenge. Congrats.
How to improve the code:
Take some time to refactor your code, JavaScript Refactoring Techniques:
and Refactoring JavaScript: Turning Bad Code into Good Code
In the following section of code, I think your class names ‘online’ and ‘offline’ are switched. Or maybe you decided to change the CSS class instead to make it work.
success: function(data1) {
logo = data1.logo;
chName = data1.display_name;
chUrl = data1.url;
if (data.stream === null) {
status = "<div id='row1' class='row online'>"; // shouldn't this be class of 'offline'?
description = "Offline";
} else {
status = "<div id='row1' class='row offline'>";
description = data.stream.channel.status; // // shouldn't this be class of 'offline'?
}
Also, you have an error showing in your console, because you added jQuery-ui before adding jQuery in your Codepen external JavaScript files section.
Thank you for the feedback! I fixed the css for the online/offline issue and corrected the jquery error
Thanks roxroy! I will definitely try to add more functions and break things up. As for tidy js, i have never heard of it. I will look into it.
Each Codepen module (HTML, CSS, and JS) have a Tidy feature (under the dropdown on the right of each module ) which will attempt to indent your code.