title: Simple AJAX example - load data from txt file
body: <p>I'm trying to do a basic AJAX tutorial to read data from a file, hello.txt, into my webpage. hello.txt and my current html webpage are in the same directory. Does anyone know what I'm doing wrong? Nothing happens when I load the page.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;&lt;title&gt;Ajax Test&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      var xmlHttp = new XMLHttpRequest();
      xmlHttp.open("GET", "hello.txt", true);
      xmlHttp.addEventListener("load", ajaxCallback, false);
      xmlHttp.send(null);
      function ajaxCallback(event){
          alert( "Your file contains the text: " + event.target.responseText );
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>