title: JSON Parse Error: unexpected end of data at line 1 column 1 of the JSON data
body: <p>I have a database, analysis.php and index.php webpages. The analysis.php gets the data from the database, sorts it in a required pattern, and then echoes the <code>json_encode($array);</code> into a <code>div</code> with the id 'data'. I am trying to get that JSON Data and parse it in the index.php page.</p>
  
  <p>However I am getting an error. <code>SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data</code></p>
  
  <p>I am trying to get this data everytime the user selects an option from a select box. </p>
  
  <p>My jQuery code is:</p>
  
  <pre><code>$(document.body).on('change', '.select' , function () {
      var identification = $(this).val();
      var JSONText = $(this).closest('div[id|="module"]').find('p[id="JSON"]');
      JSONText.load('analysis.php?data=' + identification + ' #data');
      console.log("JSON Imported: '" + identification + "'");
      var obj = jQuery.parseJSON(JSONText.text());
      console.log(JSONText.text());
  });
  </code></pre>
  
  <p><strong>EDIT:</strong> As you can see I have the snippet <code>console.log(JSON.text());</code>. The output of the JSON that I get is correct. The only issue I think might be is that the quotes are all <code>"</code> instead of the JSON quotes being different from the outer quotes.</p>