I have three functions. One is an AJAX call, one is a callback function given to this AJAX function, and the last one is a completely independent function that waits for the AJAX functions to finish. The third function has to remain completely independent from the AJAX function, it can not be passed as a parameter to the AJAX function. My code: I have three functions. One is an AJAX call, on