Index.html
function drawChart() {
var jsonData = $.ajax({
url: "server.php?startdate=" + start_date + "&enddate=" + end_date + "&type=" type,
dataType: "json",
async: false
}).responseText;
var obj = jQuery.parseJSON(jsonData);
var data = google.visualization.arrayToDataTable(obj);
(...)
This vars: start_date, end_date and type should be obtained by a form without refreshing the page, so I can send it to server.php and do some stuff
How can I do that without change this jsonData structure etc ?
Because I need it to build charts.
Thanks one more time 🙂
ps: Notice me if I wasnt clear 🙂
Imagining a form (such as the one below) on your page, some jQuery would allow you to grab the values entered into the text fields and store into javascript variables that you can then use in your drawChart() function.