title: Run javascript without web server
body: <p>I have a <code>index.html</code> page and link to another javascript file <code>d3.html</code>. In <code>d3.html</code> javaScript file the javaScript code do some interesting stuff with a local file <code>amazon.txt</code> (in my computer). I code and test in local XAMPP web server and everything works fine. However, if i close the XAMPP (web server), the <code>d3.html</code>cannot be loaded. The <code>d3.html</code> have an error <code>Cross origin requests are only supported for protocol schemes</code></p>
  
  <p>In <code>index.html</code>:</p>
  
  <pre><code>&lt;p&gt;&lt;a href="d3.html"&gt;link&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>in <code>d3.html</code>:</p>
  
  <pre><code>$.get('amazonCut.txt', function (data) {
            // interesting stuff
          }
  </code></pre>
  
  <p>If I close XAMPP, index.html can be loaded but d3.js cannot. I browsed the stackoverflow and changed above code to:</p>
  
  <pre><code>&lt;p&gt;&lt;a href="http://localhost/d3.html"&gt;link for complete result &lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$.get('https://localhost/amazonCut.txt', function (data) {
            // interesting stuff
          }
  </code></pre>
  
  <p>but it won't work. The reason I am doing this because the instructor only clicks the index.html file when grading without setting any web server.</p>