title: JavaScript "is not a function" error when calling defined method
body: <p>This is my code:</p>
  
  <pre><code>request_xml: function()
          {
          http_request = false;
                      http_request = new XMLHttpRequest();
                       if (http_request.overrideMimeType) 
                              {
                              http_request.overrideMimeType('text/xml');
                              }
                            if (!http_request)
                            {
                                  return false;
                            }
                          http_request.onreadystatechange = this.response_xml;
                          http_request.open('GET', realXmlUrl, true);
                          http_request.send(null);
                          xmlDoc = http_request.responseXML;
  
  },
  
  
  
  response_xml:function ()
      {
          if (http_request.readyState == 4)
          {
              if(http_request.status == 404 &amp;&amp; countXmlUrl&lt;=3)
              {
                  countXmlUrl++;
  
                  realXmlUrl = xmlUrl[countXmlUrl];
                  this.request_xml();
              }
              if (http_request.status == 200)
              {
                  xmlDoc = http_request.responseXML;
                  alert("need to update3");
                  this.peter_save_data();
              }
  
          }
      },
  
  peter_save_data:function()
      {
  // removed function code
  },
  </code></pre>
  
  <p>Strangely, the alert fires without a problem but the function call underneath gives me this error:</p>
  
  <pre><code>Error: this.peter_save_data is not a function
  </code></pre>
  
  <p>Calling the same damn function from another function elsewhere works fine.</p>