title: Unexpected end of input in JS
body: <p>I am trying to load a JSON file through javaScript. I have place button in the HTML that executes the function <code>loadAJAX</code>. But I keep getting an error on line 11 <code>var items = JSON.parse(request.responseText);</code> that says <code>unexpected end of input</code>. I have checked several times and cant find a solution to this. <a href="http://webprolearner.ueuo.com/ajax_json/" rel="nofollow">Test SITE</a></p>
  
  <p><strong>script.js</strong></p>
  
  <pre><code>function loadAJAX() {
      var request;
      if(window.XMLHttpRequest){
          request = new XMLHttpRequest();
      } else {
          request = new ActiveXObject("Microsoft.XMLHTTP");
      }
      request.open("GET", "data.json");
      request.onreadystatechange = function (){
          if((request.status === 200) &amp;&amp; (request.readyState === 4)){
                  var items = JSON.parse(request.responseText);
                  var output = "&lt;ul&gt;";
                  for (var key in items){
                      output += "&lt;li&gt;" + items[key].colorName + "&lt;/li&gt;";
                  }
                  output += "&lt;/ul&gt;";
                  document.getElementById("update").innerHTML = output;
  
  
              }
      };
      request.send();
  }
  </code></pre>
  
  <p>data.json</p>
  
  <pre><code>  {
      "colorsArray":[{
              "colorName":"red",
              "hexValue":"#f00",
              "info" : "My favorite color."
          },
          {
              "colorName":"green",
              "hexValue":"#0f0",
              "info" : "Old color for old things, like food ew."
  
          },
          {
              "colorName":"blue",
              "hexValue":"#00f",
              "info" : "Reminds me of bruised arm."
          },
          {
              "colorName":"cyan",
              "hexValue":"#0ff",
              "info" : "Not an idea what color this is."
          },
          {
              "colorName":"magenta",
              "hexValue":"#f0f",
              "info" : "Every girl talks about her color being this."
          },
          {
              "colorName":"yellow",
              "hexValue":"#ff0",
              ""info" : "My mom likes yellow."
          },
          {
              "colorName":"black",
              "hexValue":"#000",
              "info" : "Well now look at this color the new white lol."
          }
      ]
  }
  </code></pre>