since you are getting back the XMLHttpRequest object, you can always look at
active_project_categories_ajax.readyState
active_project_categories_ajax.status
the readyState needs to be 4 for it to be completed (success or error). so if it is less than 4, then it is still active.
this is the readyState:
// states
const unsigned short UNSENT = 0;
const unsigned short OPENED = 1;
const unsigned short HEADERS_RECEIVED = 2;
const unsigned short LOADING = 3;
const unsigned short DONE = 4;
quoted from: http://www.w3.org/TR/XMLHttpRequest/#the-xmlhttprequest-interface
You cannot look at the status before readyState becomes 4. otherwise there may be an exception raised. (actually, i wrote a php file that return 1MB of data... and when the readyState was 3, the status was also 200. i suspect the status would be 200 if the readyState stopped at 2 as well).