Im trying to get the basic PHP example to work. 

This is what I want to work, but does not:

function drawChart() {
      var jsonData = $.ajax({
          url: "getData.php",
          dataType:"json",
          async: false
          }).responseText;
          
      // Create our data table out of JSON data loaded from server.
      var data = new google.visualization.arrayToDataTable(jsonData);

my getData.php does some sql and parsing. If I do this instead, it works 
fine, just only once since its php instead of a jquery ajax call :

function drawChart() {
          
      // Create our data table out of JSON data loaded from server.
      var data = new google.visualization.arrayToDataTable( <?php include 
'getData.php'; ?> )

If I do 

var jsonData = $.ajax({
          url: "getData.php",
          dataType:"json",
          async: false
          }).responseText;

document.write(jsonData);


      // Create our data table out of JSON data loaded from server.
      var data = new google.visualization.arrayToDataTable( PASTE STUFF HERE );

and then run it once to cut and paste the output into PASTE STUFF HERE then 
it works fine. If I actually use the jsonData variable as in the example, 
it does not work. What newb mistake am I making here?
 


-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to