title: Always XMLHttpRequest readyState is 1 and Status 0
body: <p>I am using the below code to create XMLHttpRequest object. But the status is 0 and readyState is 1 always. Please guide me what mistake I am making.</p>
  
  <p>The code flow starts from updateAllZipsDTVEligible function.</p>
  
  <pre><code>var request;
  function createRequest() {
      if ( typeof XMLHttpRequest != "undefined" ) {
          return new XMLHttpRequest();    
      } else if ( window.ActiveXObject ) {
          var versions = [ "MSXML2.XMLHttp.5.0",
              "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0",
              "MSXML2.XMLHttp", "Microsoft.XMLHttp" ];
  
          for ( var i = 0; i &lt; versions.length; i++ ) {
              try {
                  xmlHttp = new ActiveXObject(versions[i]);
                  return xmlHttp;
              } catch ( e ) {}
          }
      }
  
      throw new Error("XMLHttp object could not be created.");
  }
  function runQuery(method, readyFunc) {
      request = createRequest();
      request.open("GET", "../dispatcher/updateDTV/" + method, true);
      request.onreadystatechange = function () {
          if ( request.readyState == 4 ) {
              if ( request.status == 200 ) {
                  readyFunc();
              } else {
                  alert("Status = " + request.status);
              }
          }
      };
      request.send(null);
  }
  function updateAllZipsDTVEligible() {
      //var countySelected =  document.getElementById("countyId").value;
      var countySelected =  "23185";
      runQuery("updateDTVEligible?countyId=" + countySelected, updateMsg);
  }
  </code></pre>