title: Error "object is not a function" with array
body: <p>I'm fairly new to JavaScript and AJAX, but I'm trying to take an AJAX's requests' response text and split it into an array (the response text is comma separated). Here's the error I get:</p>
  
  <p><code>Uncaught TypeError: object is not a function localhost:36
  myrequest.onreadystatechange</code></p>
  
  <p>Here's my code:</p>
  
  <pre><code>var currentpicid;
  var currentcat;
  var currentindex;
  myrequest.onreadystatechange=function(){
      if (myrequest.readyState==4 &amp;&amp; myrequest.status==200){ //request successful
          var infoarray = myrequest.responseText.split(',');
          currentpicid = infoarray(0);
          currentcat = "top";
          currentindex = index;
  
          document.getElementById("image").innerHTML=myrequest.responseText;
      }
  }
  </code></pre>
  
  <p>Can anyone help me? I have verified that my PHP page is just outputting a comma separated list of values. Thanks!</p>