title: Loading a text file through AJAX gives restricted URI error
body: <blockquote>
    <p>I mentioned i read the suggested link ...and Could not able to understand the
    suggestion .."Use Greasemonkey to modify Pages and start writing some
    javascript to modify a web page</p>
  </blockquote>
  
  <p>I am loading a text file with <code>$.ajax</code>. When running the code on Firefox, I get the following error:</p>
  
  <blockquote>
    <p>Error: ["Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "&lt;unknown&gt;"]</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;
  &lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      $(document).ready(function () {
          $("button").click(function () {
              $.ajax({ url: "demo_test.txt",
                  success: function (result) {
                      $("#div1").html(result);
                  },
                  error: function (abc) {
                      alert(abc.statusText);
                  },
                  cache:false
              });
              return false;
          });
      });
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="div1"&gt;&lt;h2&gt;Let jQuery AJAX Change This Text&lt;/h2&gt;&lt;/div&gt;
  &lt;button&gt;Get External Content&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've already read the following questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2666839/firefox-reading-web-page-from-local-js-file-access-to-restricted-uri-denied">firefox reading web page from local JS file -- access to restricted URI denied, code: 1012, nsresult: NS_ERROR_DOM_BAD_URI</a></li>
  <li><a href="https://stackoverflow.com/questions/1758183/error-exception-access-to-restricted-uri-denied-while-calling-ajax?rq=1">Error: [Exception... &quot;Access to restricted URI denied&quot; .... while calling $.ajax method</a></li>
  </ul>
  
  <p>It was suggested that file system should not be used, so changed the URL to <a href="http://demo_test.txt" rel="nofollow noreferrer">http://demo_test.txt</a>, but that did not solve the issue.</p>
  
  <p>I also heard that it might be because of a cross domain issue. If so, what exactly is meant by that, and how should I solve the problem?</p>