M
Martin Honnen
Börni wrote:
Well with event based programming you can't return a value from the
onreadystatechange event handler, you need to somehow set that up
differently, the onreadystatechange event handler could call a function
and pass the responseText to it.
i want to do something like that:
this.xmlhttp.onreadystatechange = return (function () {
if (myRequest.readyState === 4) {
return myRequest.responseText;
}
});
But i just get an Syntax error. How else could i return the responseText?
Well with event based programming you can't return a value from the
onreadystatechange event handler, you need to somehow set that up
differently, the onreadystatechange event handler could call a function
and pass the responseText to it.