title: Javascript parsing JSON without jQuery
body: <p>I'm following <a href="http://www.amcharts.com/tutorials/using-php-to-hook-up-charts-to-mysql-data-base/" rel="nofollow">this</a> example from amCharts but I can't load JSON from PHP file, this what have I done:</p>
  
  <pre><code>AmCharts.loadJSON = function(url) {
       if (window.XMLHttpRequest) {
           var request = new XMLHttpRequest();
       } else {
           var request = new ActiveXObject('Microsoft.XMLHTTP');
       }
       request.open('GET', url, false);
       request.send();
       return eval(request.responseText);
  };
  
  
  AmCharts.ready(function() {
     var chartData = AmCharts.loadJSON('chart.php');
     console.debug(chartData);
   });
  </code></pre>
  
  <p>But I always get: </p>
  
  <pre><code>return eval(request.responseText);
  Uncaught SyntaxError: Unexpected string 
  </code></pre>
  
  <p>I have googled but all solutions include jQuery, and it's recommended not to use eval.</p>