Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

AJAX Basics - The Office Status Project Revisited

No obvious error .... working on Chrome browser :smile:

$(document).ready(function (){
$.getJSON('../data/employees.json', function (response){
  var statusHTML = '<ul class="bulleted">';//open ul
  $.each(response, function(index, employee){
    if(employee.inoffice === true){
      statusHTML += '<li class = "in">';//create in
    }
    else { 
            statusHTML += '<li class = "out">';//create out
    }//end if
            statusHTML += employee.name + '</li>'; 
  });//end each
       statusHTML += '</ul>';//close ul
        $('#employeeList').html = statusHTML;//update HTML
});//end JSON
});//end ready

Following the video, a list was supposed to appear in the workspace's preview.... that didnt happen

4 Answers

Jquery is so much better. But cool that you got working in vanilla!

yes

can you give me a hint as to what my mistake may be?

are you console logging anything out? did you check for typos?

console.log not working..... @Andrew McCormick any tips :smile:

is it possible to call people for help?

https://treehouse-code-samples.s3.amazonaws.com/AJAX_Basics_Project_Files.zip

There is the download link for the finished project. Are you doing it in the workspace because you cannot do it outside of the workspace. It's treehouse specific api request.

ok but still not up https://w.trhou.se/zq77jwgl0w