title: Trouble with ajax request response handler
body: <p>Very new to ajax and trying to make an ajax request function to be reused. Firebug says the request is going through and returning the correct data from my php file. However, the response is not being inserted into the div in my html. here is my code:</p>
  
  <pre><code>function ajaxRequest(url, method, data, asynch, responseHandler)
  {
      var request = new XMLHttpRequest();
      request.open(method, url, asynch);
  
      if (method == "POST"){
          request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
      }
      request.onreadystatechange = function()
      {
          if (request.readyState == 4) {
              if (request.status == 200) {
                  responseHandler(request.responseText);
              }
          }
      }
  
      request.send(data);
  } 
  
  function changeText() {
      var data = "";
      ajaxRequest("../PHP/CODE/changeText.php", "Get", data, true, insertNewText);
  }
  
  function insertNewText() {  
      var response = request.responseText;
      var testDiv = document.getElementById("rightColumn");
      testDiv.innerHTML = response;
  } 
  </code></pre>