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 (retiring) jQuery and AJAX The Office Status Project Revisited

Employee Status does not load in Chrome

Even when I use your finished code Dave google chrome will not load the employee status there are no errors in the console

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

I even disabled my dev tools since that would cause problems with other challenges if there enabled.

1 Answer

Hey, Josuel. I suppose this issue is some type of security measure, but yes: XMLHttpRequests to a local file does not seem to be supported at the moment for Chrome and IE. If you reference this same code from Firefox, it should work like a charm. Here's a link to a discussion on the topic.

thanks alot appreciate it.