Op dinsdag 1 september 2015 18:08:35 UTC+2 schreef Webmaster NDO: > > 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? > The query will be changed in the process I found out when looking to the error in the console completely to: https://script.google.com/macros/s/AKfycbwVDC590dTq8PAr7ueYAzDV8KrajdTYce2ZNxi59V0L/gvizdata?nocache_id=2&token=AJuLMu0DdN5Gc-gPzfUQIUGi3oj5J8ma0w%3A1441135094165&gviz_url=https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2F1Cyu8C3OFV25nOw0qc2RdrGZBdrciegu-eZnkjCr2Wac%2Fgviz%2Ftq%3Fsheet%3DAlleInschr1Dans%26headers%3D1%26tq%3Dselect%2520D%252CE%252CF%252CI%252CJ%252CK%252CN%2520where%2520C%2520%253D%2520date%2520%222015-10-04%22&tqx=reqId%3A0 which gives me the OK 400 error
-- 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/f102a40d-f355-4d70-8fd2-05b895f4fe3e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
