title: What is readyState and status?
body: <pre><code>function hello()
  {
  
      var request = getXHR();
      request.open("GET","A?value="+document.getElementById('a').value+"",true);
      request.send(null);
      request.onreadystatechange=function()
      {
          if(request.readyState==4)
          {
              if(request.status==200)
              {
                  var val=request.responseText;
                  document.getElementById('a').value=val*10;
  
              }
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>I found the above code..in an ajax tutorial...I cannot understand the reason for using </p>
  
  <pre><code>request.readyState==4
  request.status==200
  </code></pre>
  
  <p>Can anyone explain me the reason for using this code segment?</p>