Welcome to the Treehouse Community
Looking to learn something new?
Need help understanding var statusHTML = '<ul class="bulleted">';
I do not understand what
var statusHTML = <ul class="bulleted">;
This comes in at about 4:00 in the video.
Dave says, "I'll create a variable to hold the HTML that the call back generates.".
Is the .bulleted pulled from anywhere else in this project?
Just to expand on what Damian said,
statusHTML is also building the
ul list. You start with typing '<ul class="bulleted">' (which is a string) and then as you get each list item in the JSON data, you are constructing and appending those list items to that
ul element by adding each list item to the variable. It is a way of dynamically adding in elements. :)
A neat experiment to try is initializing the variable
statusHTML into the global scope (place the initial line: var statusHTML = '<ul class="bulleted">'; line outside of the function) and then go into your web console (if you have Chrome or Firefox) and type out "statusHTML". You'll see it has become a pretty long string consisting of list items. :)