I'm curious about how client-side code interacts with server-side responses. I have a lengthy and complex piece of code that triggers a function which in turn executes some server-side code using a HTTPRequest Object, returning a string to the calling page. However, it seems like the client-side code is processing before the response is received, causing my code to fail. For instance, when I call my function with the HTTPRequest, the next line attempts to display the returned value in an alert, but the alert appears empty. A few lines later, the same alert displays the expected value. This has led me to believe that the initial client-side alert is rendering a string that hasn't been returned yet, while the second alert waits for the server to process the request before displaying the correct value. Is this explanation plausible? Will the client-side code run regardless of whether the HTTPRequest is completed? If so, are there any methods to prevent the client-side code from executing until a response is received from the server?