我有用这个 URL 返回表名的函数('..../default/call/json/mytables')
但我不知道如何对我的函数说它getTable()
来返回我的 URL 的值。
function getTable(){
return '.../default/call/json/mytables';
}
console.log(getTable());
function initialize() {
var $newDiv = $('<div>').attr('id','chart_div');
$('#reportingContainer').append($newDiv);
// Replace the data source URL on next line with your data source URL.
// Specify that we want to use the XmlHttpRequest object to make the query.
var query = new google.visualization.Query('/datasource?table='+getTable());
// Optional request to return only column C and the sum of column B, grouped by C members.
query.setQuery('select zone_name, sum(cost) group by zone_name');
// Send the query with a callback function.
query.send(drawChart);
}
谢谢。