title: Reading a simple text file using AJAX. Access Denied error on open function
body: <p>I just started learning Ajax and I am stuck here.</p>
  
  <p>I created 3 files
  1. HTML File with code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script language="javascript" src="../AjaxLearning.js"&gt;
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="gethelp"&gt;
  &lt;h3&gt;Text should Change&lt;/h3&gt;
  &lt;/div&gt;
  &lt;input type='button' onclick='knowYourBrowser()'
      value='Know Your Browser'&gt;
  &lt;input type='button' onclick='loadXMLDoc()' value='Need Help?'&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <ol>
  <li><p>A Text file placed at same directory where the html file is placed
  text in the file is:
  I am here to help you</p></li>
  <li><p>A java script file placed at a location above the html file</p>
  
  <p>function knowYourBrowser()
  {
      alert("I reached here");
      var xmlhttp;
      if(window.XMLHttpRequest)
      {
          xmlhttp=new XMLHttpRequest();
          alert ("IE7+, fox, chrome, netscape");
      }
      else
      {
          alert ("IE5, 6");
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
  }</p>
  
  <p>/* Read a text file from the directory*/
  function loadXMLDoc()
  {</p>
  
  <pre><code>var xmlhttp;
  if (window.XMLHttpRequest)
  {
      xmlhttp=new XMLHttpRequest();
  }
  else
  {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  
  xmlhttp.onreadystatechange=function()
  {   
      if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
          document.getElementById('gethelp').innerHTML = xmlhttp.responseText;
      }
  };
  xmlhttp.open("GET","Help.txt",true);
  xmlhttp.send(null);
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>but I am getting the below error message</p>
  
  <pre><code>SCRIPT5: Access is denied.
  
  AjaxLearning.js, line 39 character 2
  </code></pre>
  
  <p>I dont know what I am missing here. Please point out the gaps. </p>
  
  <p>Thanks in Advance
  Himanshu</p>