Hi,

I am using this code from our server. At first this was working properly
with no errors. nowadays i am getting this error "google is undefiend". when
i restart the server, i am not getting this error. After few hours again i
am getting this error. could please help me why this is happening.

Thanks much.


On Wed, Jul 27, 2011 at 7:13 PM, asgallant <[email protected]>wrote:

> I don't know if you can include your js in the same script that you call
> Google's jsapi from (I've never seen it done, and it didn't work when I
> tried it on the visualization playground).  Separate them out, load the
> Google visualization API, and replace the onload function in your body tag
> with google.setOnLoadCallback():
>
> <script type="text/javascript" 
> src="http://www.google.com/**jsapi<http://www.google.com/jsapi>"
> />
> <script>
> google.load('visualization', '1', {packages: ['corechart']});
> google.setOnLoadCallback(init);
>
> function init() {
>      graph1(1);
>      graph2(2);
> }
> ...rest of your code...
> </script>
>
> setOnLoadCallback takes a function as a parameter (I arbitrarily made one
> named init), not a function call:
>
> // this works:
> google.setOnLoadCallback(init);
>
> // this fails:
> google.setOnLoadCallback(graph1(1));
>
> Give that a spin and see if it works.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to