title: xml_http.onreadystatechange is not a function
body: <p>I'm trying to get over ajax request, but Chrome console shows me this message:
  xml_http.onreadystatechange is not a function</p>
  
  <p>Here is my JS code:</p>
  
  <pre><code>function ajax_request () {
              var xml_http = new XMLHttpRequest();
  
              xml_http.onreadystatechange(function () {
                  if(xml_http.readyState == 4 &amp;&amp; xml_http.status == 200){
                      var result = document.getElementById('result');
                      result.innerHTML = xml_http.responseText;
                  }
              });
              xml_http.open('GET', 'data.php', true);
              xml_http.send();
          }
  </code></pre>
  
  <p>Here is the HTML:</p>
  
  <pre><code>&lt;button onclick="ajax_request();"&gt;Click&lt;/button&gt;
      &lt;div id="result"&gt;&lt;/div&gt;
  </code></pre>