title: get ajax responseText javascript
body: <p>I am trying to the responseText from an onstateready in an XMLHttpRequest ajax call. currently all I am getting out of my responseText is "object event" I ran it through a String() and now when I do a typeof on it, it returns string. My console header is showing a response of the content desired, but my responseText is not getting it. what am I doing wrong?</p>
  
  <p>I should note this does not involve jquery, keeping it native.</p>
  
  <pre><code>                   function getPatterns() {
                          var url = document.URL;
                          var httpRequest;
  
                          if(window.XMLHttpRequest) { // modern browsers
                              httpRequest = new XMLHttpRequest();
                          } else if (window.ActiveXObject) { // IE 8 and older
                              httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                          }
                          httpRequest.onreadystatechange = function(responseText){
                              responseText = String(responseText);
                              console.log('responseText: '+ typeof responseText); // returns "string"
                              console.log('responseText: '+ responseText); // returns "object event"
  
                              // process the server response
                          };
                          httpRequest.open('GET', url+'&amp;showpatterns=true');
                          httpRequest.send();
                      }   
  </code></pre>