Click to See Complete Forum and Search --> : Why i can't save the return value of XMLHTTPRequest in a variable?


web.designer.iq
05-26-2009, 04:00 PM
Hi
This code is working perfectly:
XMLHttpRequestObject.onreadystatechange = function()
{
if ( XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200 ) {
obj.innerHTML = XMLHttpRequestObject.responseText;
}
}

But i need to store the responseText value in a variable like this:
var resText = XMLHttpRequestObject.responseText;
any idea please?

bpat1434
05-29-2009, 10:20 PM
that should work perfectly fine. It's the way I do it.