title: AJAX response problem
body: <p>I've got this function:</p>
  
  <pre><code>function Ajax() {
      var xmlhttp, onready, open, response;
  
      if(window.XMLHttpRequest) {
          this.xmlhttp = new XMLHttpRequest();
      } else {
          this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      this.onready = function(onready) {
          this.xmlhttp.onreadystatechange = function() {
              if ( this.xmlhttp.readyState == 4 &amp;&amp; this.xmlhttp.status == 200) {
                  onready.call();
              }
          }
      };
  
      this.open = function(_filename, _method) {
          this.xmlhttp.open(_method, _filename, true);
          this.xmlhttp.send(null);
      };
  
      this.response = function() {
          return this.xmlhttp.responseText;
      };
  }
  
  
  function rc() {
      var ajax = new Ajax();
  
      ajax.onready(function() {
          document.getElementById("comments").innerHTML = ajax.response();
      });
  
      ajax.open("ab.php","GET");
  }
  
  rc();
  </code></pre>
  
  <p>And the request is sent fine, but i can't extract the response.</p>
  
  <ul>
  <li>It shows that readyState doesn't exist in xmlhttp object.</li>
  </ul>