I am trying to get data from a Google Spreadsheet. There is a problem with
the javascript url/select string! When I directly ask voor data with a url
like this:
https://docs.google.com/spreadsheets/d/
1Cyu8C3OFV25nOw0qc2RdrGZBdrciegu-eZnkjCr2Wac/gviz/tq?s*heet*
=AlleInschr1Dans&*headers*
=1&tq=select%20D%2CE%2CF%2CI%2CJ%2CK%2CN%20where%20C%20%3D%20date%20"2015-10-04"
I get an readible answer like this:
/*O_o*/
google.visualization.Query.setResponse({"version":"0.6","reqId":"0","status":"ok","sig":"2080065474","table":{"cols":[{"id":"D","label":"p1vnaam","type":"string"},{"id":"E","label":"p1tussenv","type":"string"},{"id":"F","label":"p1anaam","type":"string"},{"id":"I","label":"p2vnaam","type":"string"},{"id":"J","label":"p2tussenv","type":"string"},{"id":"K","label":"p2anaam","type":"string"},{"id":"N","label":"Dansklasse","type":"string"}],"rows":[{"c":[{"v":"Justin"},null,{"v":"Krijger"},{"v":"Lorraine"},null,{"v":"Voorn"},{"v":"Ballroom
Amateurs
MC"}]},{"c":[{"v":"Fred"},null,{"v":"Vierhout"},{"v":"Wilma"},null,{"v":"Vierhout-Rooswinkel"},{"v":"Ballroom
Senioren 55pl
.
.
.
}]}]}});
When I use this url to get the data via javascript like this:
var query = new google.visualization.Query(url);
then the callback response gives me an error : Error in query: OK [400]
from this responsehandler:
query.send(handleSampleDataQueryResponse);
};
function handleSampleDataQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.
getDetailedMessage());
return;
}
var data = response.getDataTable();
var table = new google.visualization.Table(document.getElementById(
'table_div'));
table.draw(data, {
height: 700
});
}
It seems you cannot use the same url for the browser as for javascript. Can
anyone point out the differences?
--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/e4d1419a-8e3a-4e3c-91ef-c7b6c4a598f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.