问题
I have a following code:
google.charts.setOnLoadCallback( drawChart );
function drawChart() { ... }
I need to pass a parameter called chartID into a drawChart() function. How can I do it? Seems google chart doesn't want to get any params :) Any ideas?
回答1:
one way is to add another function...
google.charts.setOnLoadCallback(function () {
drawChart(chartID);
});
function drawChart(chartID) { ... }
来源:https://stackoverflow.com/questions/45255690/google-charts-how-to-pass-a-parameter-into-a-callback-javascript