JavaScript XML request without callback?

Hi there,

Are there any JavaScript XML libraries out there that let us make XML calls without requiring a callback?
Why? Because we are trying to rapidly develop an application and with all the callbacks, things are really looking messy in the code.

the_cymanAsked:
Who is Participating?
 
the_cymanConnect With a Mentor Author Commented:
It is possible:
function GetSynchronousJSONResponse(url, postData) {
    var xmlhttp = null;
    if (window.XMLHttpRequest)
        xmlhttp = new XMLHttpRequest();
    else if (window.ActiveXObject) {
        if (new ActiveXObject("Microsoft.XMLHTTP"))
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        else
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
        // to be ensure non-cached version of response
    url = url + "?rnd=" + Math.random();
   
    xmlhttp.open("POST", url, false);//false means synchronous
    xmlhttp.send(postData);
    var responseText = xmlhttp.responseText;
    return responseText;
}
0
 
jmanGJHS97Connect With a Mentor Commented:
Any asynchronous interactions with server components require callbacks.  Maybe instead you could restructure the callbacks to be more efficient, but you can't simply avoid them.
0
 
XxavierCommented:
XML calls are call backs, to get data from server you have to call back, period :(
0
All Courses

From novice to tech pro — start learning today.