Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
218,654 Points

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

1 Answer

Steven Parker
Steven Parker
218,654 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.