Synchronus XML Request
Posted on 2007-04-11
Often when I'm programming, I find I would be much better served by a synchronus XML HTTP request than an asynchronus one. For instance, if I'm doing a postback from a popup window I want to close as soon as the data is retrieved, an asynchronus request just won't work properly.
Up until now, I've been using a "magic button" with it's click event registered to an asyncronus version of the function call I want to make, and then calling triggering the click via script before closing the window (this avoids orphaning the XMLHttpObject before any asynchronus callback requests are made).
Now, Ideally, I want to just return the result of a synchronus request DIRECTLY from the calling function... that is, no "onreadystatechange" (callback) function.