title: Unable to use AJAX to read a local text file?
body: <p>I am trying to a simple HTML page working the text file is in the same directory but it does not want to work (ie unresponsive button). I did look at numerous examples but none of them shed light to the issue. The text file is in the same directory, I have tried absolute and relative paths. Is it possible that due to my orignation and request location being the same AJAX would shut down. </p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function loadXMLDoc()
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  var xmlhttp = new XMLHttpRequest();
  
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
      }
    }
  xmlhttp.open("GET","\test.txt",true);
  xmlhttp.send();
  document.getElementById("myDiv").innerHTML=xmlhttp.responseText
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="myDiv"&gt;&lt;h2&gt;By the power of AJAX!!!!!!!&lt;/h2&gt;&lt;/div&gt;
  &lt;button type="button" onclick="loadXMLDoc()"&gt;Change Content&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>UPDATE corrected error on the cut and paste. By not working I mean the button does nothing. I have looked at other examples and none of them seem to work. When I try and run from my drive but work from the webpage. I do not have a server but I am only using text so I should not need anything beyond this. </p>