Hi Doreen,

Your URL is the problem.  As the documentation page at
https://developers.google.com/chart/interactive/docs/querylanguage   says,
you need to add '/gviz/tq?tq=' to your URL, without the pubhtml, like this:
  '
https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/gviz/tq?tq=
'

Here is a working version of your code:
http://jsfiddle.net/dlaliberte/Ltwe7p1b/

On Wed, Jul 1, 2015 at 9:35 AM, <[email protected]> wrote:

> Hello,
>
> Can someone specify the format that the data source URL is suppose to be
> in? This is for a Google docs spreadsheet. I've tried the one shown on the
> API Language Reference page, but I still get a 'Request timed out' error.
> I'll paste the html code, and if the URL is correct, can anyone see what is
> wrong with the code?
>
> <!DOCTYPE html>
> <html>
>  <head>
>   <script type="text/javascript" src="
> https://www.google.com/jsapi";></script>
>    <script type="text/javascript">
>     google.load("visualization", "1", {packages:["table"]});
>    function initialize() {
>     var query = new google.visualization.Query('
> https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/pubhtml'
> );
>     var string = prompt('Enter query:');
>     query.setQuery(string);
>     query.send(queryResponse);
>    }
>    function queryResponse(response) {
>     if (response.isError()) {
>      alert(response.getMessage() + response.getDetailedMessage());
>      return;
>     }
>     var data = response.getDataTable();
>     var table = new
> google.visualization.Table(document.getElementById('table_div'));
>     alert(data);
>     table.draw(data);
>    }
>   </script>
>  </head>
>  <body>
>   <button id='query' onclick='initialize()'>Enter Query</button>
>   <div id="table_div"></div>
>  </body>
> </html>
>
>  --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to