title: Asynchronous and Synchronous XMLHttpRequest in ajax
body: <p>I am new to ajax and am following Lynda "Javascript and Ajax" tutorial.Here is the problem i have come across.</p>
  
  <p>I have a text document named "data" which has text HELLO WORLD saved on it.</p>
  
  <p>My index.html file is:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;JavaScript AJAX&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My javascript file is:</p>
  
  <pre><code>for(var i = 0; i &lt; 100; i++){
  var request = new XMLHttpRequest();
      request.open('GET', 'data.txt',false);
      request.send();
      console.log(request);
      document.writeln(request.responseText);
  
  }
  </code></pre>
  
  <p>My question is when i do Synchronous XMLHttpRequest by giving argument false(on request.open() ), my browser displays "HELLO WORLD" 100 times as per the code.But as i try doing Asynchronous XMLHttpRequest by giving argument true or nothing as default, the browser doesnt display anything.Why is it so?</p>
  
  <p>Could anyone please help me on this?I am grasping some knowledge on asynchronous and synchronous requests.What has these got to do with the code above acting differently?Am I missing out on something?</p>