title: why eval() doesn't work with output of JSON.parse()?
body: <p>I want to showcase some javascripts. To do so I read the contents of .js files with php file_get_contents() then json_encode() and echo the results, then on the fore end I read the result through $.get() and then I do a JSON.parse() on the results(I have tried not parsing it) but still eval() doesnt work on the result.</p>
  
  <p>Oddly enough if I copy the result of json_encode() and paste it in a js variable then eval() works!</p>
  
  <p>What did I do wrong?</p>
  
  <p>Server side:</p>
  
  <pre><code>$name=$_GET['name'];
  $t=  file_get_contents('../graphics/'.$name);
  $t=  json_encode($t);
  echo $t;
  </code></pre>
  
  <p>client side:</p>
  
  <pre><code>$.get("php_lib/readGraph.php",{ name:name}, function(data, status){
                      if(status){
                         eval(JSON.parse(data));
                         }
                      else {
                          alert('Ajax error');
                      }
                      });
  </code></pre>