From: rakata.warrior on
Hello. I have a problem with google visualization (http://
code.google.com/intl/ru-RU/apis/visualization/documentation/
using_overview.html). Examples give by google are working fine, but if
I move google.load from scripts body to any function, loaders stops
work. I mean, this code

function load(){
google.load('visualization', '1', {'packages':
['piechart']});
google.setOnLoadCallback(drawChart);
}

doesn't work while this one

<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['piechart']});
google.setOnLoadCallback(drawChart);

does pretty good. But I have a website with many frames and I need to
make various graphs on every frame so the idea was to make a function
in a javascript library file which would draw needed graphs. But I
can't do it because I have no idea what's going on with google.load -
why doesn't it work when calling inside of a function?
Any help would be greatly appreciated.
From: Thomas 'PointedEars' Lahn on
rakata.warrior(a)gmail.com wrote:
^^^^^^^^^^^^^^^^^^^^^^^^
Who?

> Hello. I have a problem with google visualization (http://
> code.google.com/intl/ru-RU/apis/visualization/documentation/
> using_overview.html).

You are looking for
<http://groups.google.com/group/google-visualization-api>.

> Examples give by google are working fine,

That is a useless statement. *Which* examples, *where* are they running
fine?

> but if I move google.load from scripts body to any function, loaders stops
> work. I mean, this code
>
> function load(){
> google.load('visualization', '1', {'packages':
> ['piechart']});
> google.setOnLoadCallback(drawChart);
> }
>
> doesn't work

That is no error description at all.

> while this one
>
> <html>

Not Valid. <http://validator.w3.org/>

> <head>
> <script type="text/javascript" src="http://www.google.com/jsapi"></
> script>
> <script type="text/javascript">
> google.load('visualization', '1', {'packages':['piechart']});
> google.setOnLoadCallback(drawChart);
>
> does pretty good. But I have a website with many frames

That is no useful description either.

> and I need to make various graphs on every frame so the idea was to make a
> function in a javascript library file

There is no "javascript". There is also no "library file" there.

> which would draw needed graphs. But I can't do it because I have no idea
> what's going on with google.load -

That is the price tag attached to minified, apparently underdocumented,
needlessly dynamically loaded, code. BTW, I have tried
<http://code.google.com/apis/visualization/documentation/examples.html>;
it took 10 seconds before I could scroll the document in Iceweasel 3.6.4
without hassle. The average visitor would have navigated away by then.
This should give you pause.

> why doesn't it work when calling inside of a function?

Probably it does, but given overall Google code quality it might not.

> Any help would be greatly appreciated.

<http://jibbering.com/faq/#posting>
<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16