title: Reading a json file in JavaScript returns only the HTML code
body: <p>I'm trying to open a json file in JavaScript in order to modify and display it. There is plenty of ways to do it around here on Stack Overflow. However, when using the following method, my data only contains a string of my html code, which I find very strange! </p>
  
  <pre><code>    function loadFile(filePath) {
        var result = null;
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET", filePath, false);
        xmlhttp.send();
        console.log('test1')
        if (xmlhttp.status==200) {
            console.log('test2')
          result = xmlhttp.responseText;
        }
        console.log('test3')
        return result;
      }
  
  var mystuff=loadFile("./mydata.json");
  alert(mystuff); // Here in mystuff I have only the content of my html code
  </code></pre>
  
  <p>and I call it with :</p>
  
  <pre><code>&lt;script  src="/script.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Even if I achieve (that's not the case yet) to open my .json, I'd like to know why my code returned my html code, and not the content of my file.</p>