While I have taken the time to explore similar questions like Pattern for wrapping an Asynchronous JavaScript function to make it synchronous & Make async event synchronous in JavaScript, I want to ensure that I consider all potential solutions.
Is it feasible to "transform" an asynchronous XmlHttpRequest into a pseudo-synchronous one by utilizing setInterval or setTimeout? My thought is that, upon successful completion of the Ajax request, a variable could be set to trigger a while loop (which has invoked either setInterval or setTimeout) along with a corresponding callback function to terminate. Am I misinterpreting the capabilities and limitations of setInterval and/or setTimeout?