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) Programming AJAX Stage 2 Challenge

Pitrov Secondary
Pitrov Secondary
5,121 Points

I don't understand what is happening

I thought that I was done so I previewed the code. Only the rooms feature was working, the employees, thing didn't work anymore, then I figured that I forgot: if (AJAX.readyState == 4 && AJAX.status === 200){}. When I added that in the code only the employees thing was working not the rooms. can someone tell me why this is happening? here is a snapshot of what I have, I am working on widget.js, and the JSON is rooms.js. thanks

Steven Parker
Steven Parker
231,269 Points

It doesn't look like your snapshot link got added to your question.

1 Answer

Steven Parker
Steven Parker
231,269 Points

In "widget.js" on line 39 you have "employeeList" instead of "roomList". This causes the request that completes first to be overwritten by the one that comes in last.