title: How to return AJAX response Text?
body: <p>I use prototype to do my AJAX development, and I use the code like this:</p>
  
  <pre><code>somefunction: function(){
      var result = "";
      myAjax = new Ajax.Request(postUrl, {
          method: 'post',
          postBody: postData,
          contentType: 'application/x-www-form-urlencoded',
          onComplete: function(transport){
              if (200 == transport.status) {
                  result = transport.responseText;
              }
          }
      });
      return result;
  }
  </code></pre>
  
  <p>And I find that the "result" is an empty string. So, I tried this:</p>
  
  <pre><code>somefunction: function(){
      var result = "";
      myAjax = new Ajax.Request(postUrl, {
          method: 'post',
          postBody: postData,
          contentType: 'application/x-www-form-urlencoded',
          onComplete: function(transport){
              if (200 == transport.status) {
                  result = transport.responseText;
                  return result;
              }
          }
      });
  
  }
  </code></pre>
  
  <p>But it didn't work also. How can I get the responseText for other method to use?</p>