JavaScript AJAX Basics (retiring) Programming AJAX Stage 2 Challenge

Pitrov Secondary
Pitrov Secondary
5,119 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
177,587 Points

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

1 Answer

Steven Parker
Steven Parker
177,587 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.