title: XMLHttpRequest - relative or absolute path?
body: <p>I'm trying to make HTTP tests in my local server.</p>
  <p>On my HTML file, I link <code>src=&quot;scripts/scriptedHTTP.js</code>:</p>
  <pre><code>   var req = new XMLHttpRequest();
     req.open(&quot;GET&quot;, &quot;file.txt&quot;, false);
     req.send(null);
     console.log(req.responseText);
  </code></pre>
  <p>I serve on <code>localhost:8000</code> with <code>python -m SimpleHTTPServer</code>.</p>
  <p><code>file.txt</code> is on the same path as <code>scriptedHTTP.js</code></p>
  <p><code>http://localhost:8000/scriptedHTTP.html</code> gets me <code>Error 404</code>.</p>
  <p>If I run <code>scriptedHTTP.js</code> with <code>node</code>, I get <code>XMLHttpRequest is not defined</code>.</p>
  <p>What I am doing wrong?</p>