Jump to content

Accessing the responseText in the "outer function"


janroald

Recommended Posts

function foo(callURL) {
    var xmlhttp = getHTTPObject();
    xmlhttp.open('POST', callURL, true);
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState == && xmlhttp.Status == 200) {
         var bar = xmlhttp.responseText;
      }
    }
    xmlhttp.send(null);
   //How can i at this point in the code return the responseText to where the function "foo" was originally called?
}

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.