title: Uncaught SyntaxError: Unexpected token d in JSON at position 0 at JSON.parse (<anonymous>)
body: <p>For several hours now I have been crazily trying to get and display json data externally using JSON.parse  but am having this error below</p>
  
  <p><strong>Uncaught SyntaxError: Unexpected token d in JSON at position 0
      at JSON.parse ()
      at index.html:10</strong></p>
  
  <p>Here is my code and effort so far. can somebody help me fix the issue. I will appreciate
      </p>
  
  <pre><code> var test = JSON.parse ('data.json');
      console.log(test);
  
  alert(test);
  
  
  
  
  
  /*
  var ourRequest = new XMLHttpRequest();
  ourRequest.open('GET', 'data.json');
  
  ourRequest.onload = function(){
      var ourData  = JSON.parse(ourRequest.responseText);
      console.log(ourData);
   console.log(ourData[0]);
  alert(ourData);
  };
  ourRequest.send();
  */
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>data.json</p>
  
  <pre><code>{
          name: "Sample Test",
          description: "This is a sample test paper to demonstrate the ReactJS UI design by components.",
          passCutoff: 0.33,       
          applyNegativeMarking: false,
          time: 1,
          questions: [
              {
              no: "1",
              qtext:"California is in which part of USA?",
              options:[
                  {text:"East"},
                  {text:"Mid"},
                  {text:"West"},
                  {text:"South"}
              ],
              ans:"West",
              marks: 3
          },
          {
              no: "2",
              qtext:"Who is Prime Minister of India?",
              options:[
                  {text:"Sonia Gandhi"},
                  {text:"Narendra Modi"},
                  {text:"Manmohan Singh"},
                  {text:"Rahul Gandhi"}
              ],
              ans:"Narendra Modi",
              marks: 2
          },
          {
              no: "3",
              qtext:"Which of the following is most popular Search Engine Company?",
              options:[
                  {text:"Microsoft"},
                  {text:"Facebook"},
                  {text:"Google"},
                  {text:"Yahoo"}
              ],
              ans:"Google",
              marks: 1
          },
          ]
      }
  </code></pre>