title: ajax onreadystatechange function not being call
body: <p>Why is this code not working (when calling the handleRequestStateChange function)?:</p>
  
  <pre><code>function ajaxRequest(){ 
   var xmlObj = new XMLHttpRequest();
   xmlObj.open("GET","1.php",true);
   xmlObj.onreadystatechange = handleRequestStateChange;
   xmlObj.send(null);
  }
  
  var handleRequestStateChange = function(){  
      if(xmlObj.readyState == 4 &amp;&amp; xmlObj.status==200){
          alert("if loaded");
      }
  }
  </code></pre>
  
  <p>but this one is(without calling the handleRequestStateChange function):</p>
  
  <pre><code>function ajaxRequest(){
  
   var xmlObj = new XMLHttpRequest();
   xmlObj.open("GET","1.php",true);
  
   xmlObj.onreadystatechange = function(){
      if(xmlObj.readyState == 4 &amp;&amp; xmlObj.status==200){
              alert("if loaded");
      }
   }
   xmlObj.send(null);}
  </code></pre>