javascript - Google query send function not doing anything -
i'm trying google sheet query can't code working when follow instructions on googles query language reference page.
(developers.google.com/chart/interactive/docs/querylanguage)
it says:
to set query string within javascript code, call setquery method of google.visualization.query class.
var query = new google.visualization.query(data_source_url); query.setquery('select dept, sum(salary) group dept'); query.send(handlequeryresponse);
my sheet here: docs.google.com/spreadsheets/d/1dqzodu0fhdeh9ls05d2-lykfhpgfq95lvgvkui_nuju/
and sheet query works fine this: docs.google.com/spreadsheets/d/1dqzodu0fhdeh9ls05d2-lykfhpgfq95lvgvkui_nuju/gviz/tq?tq=select%20a
my code here:
console.log("started") var src_url = "https://docs.google.com/spreadsheets/d/1dqzodu0fhdeh9ls05d2-lykfhpgfq95lvgvkui_nuju" var query = new google.visualization.query(src_url); query.setquery('select a'); query.send(handlequeryresponse); function handlequeryresponse(response){ console.log("handling query") }
i "started" message in console ok can't understand why send function doesn't anything? when try run code nothing. not error in console no console messages (besides "started" message @ beginning of code)
i created jsfiddle , behaves same. no console log message no error either. https://jsfiddle.net/jaspodasilva/tq07554n/2/
so question is, doing wrong?
Comments
Post a Comment