Nicklas Augustine8,383 Points
Why use readyState === 4 at all?
I cannot understand why it is wise to check for .readyState === 4? Why not just check if .status === 200 and then have the callback function running?
Seth KrogerTreehouse Moderator 56,314 Points
A readyState of 2 means, "send() has been called, and headers and status are available." In other words, if it is a successful response, the status code will be 200 but you haven't received and data in the body yet (or only partial data if readyState is 3) and still need to wait for it to come in.