Ok...
Asgallant - I want to be able to import the correct packages for the
type of chart specified by the user, whether that be corechart or
table, whatever. I don't see how using setOnLoadCallback(drawChart);
rather than setOnLoadCallback(loadPackages); will make any difference
to whether google.visualization is defined or not, the only thing that
is changing is the name of the function. On a side note, why would you
use an intermediary function rather than specifying parameters inside
the draw function?
NA - Ok, so if I use google.setOnLoadCallback(loadPackages); when can
I call the function loadPackages with the parameters to return the
boolean value? Also, that other thread is by someone else. Just to
check that I have got it correct though, the HTML page that I am using
to test functionality of this library has two script tags. The first
is the JS API from google and the second is the library that I am
writing. Will the library be able to call functions from JS API like
this?
I appreciate the help guys! Cheers,
Dan
On Jul 20, 9:04 pm, NA <
nabeel.a...@gmail.com> wrote:
> You had:
>
> if (google.setOnLoadCallback(loadPackages(myChart.type))
>
> You need to pass setOnLoadCallback a function object. In your case,
> you're actually calling the function, not passing a function object.
> So what happens is that:
>
> 1) loadPackages(myChart.type) is executed
> 2) the output of that function call is passed to setOnLoadCallback
>
> That's not what you want to do. You want to pass the function
> instead. So you should do:
>
> google.setOnLoadCallback(loadPackages);
>
> Here, we aren't actually calling the loadPackages function. We are
> just referring to it by its name.
>
> Also, is all this because you had difficulty loading multiple packages
> at once? This was just a typo you were making. I responded to your
> thread about that here:
>
>
http://groups.google.com/group/google-visualization-api/browse_thread...