Thank you for your replay. I tried some possibilities:
1. I directly called initialize2. As you mentioned the problem is the same. 2. In a first js-file I do the same like above. But the call the call for drawSecChart() comes from another js-file. I tried this, because I want to a the second js to control the select-menu in a xul-window. Drawing the charts etc. should be organized in the first js that belongs directly to an html-page. This page I load as an iframe in the xul-window. The "results" are still the same 3. I reorganized the iframe. The loaded html contains allready the select-menu and is controlled with the js-file, that loads the google-API etc. With this "solution" I get what I intended to do. Not on the way I wanted, but working... 2013/3/19 asgallant <[email protected]> > Don't call the loader again, as the API is already loaded; just call > initialize2. > > Also, it should be noted that the API is known to have problems with being > loaded in this manner (dynamically created script tag and calling > google.load inside other functions), so it is possible that you will see > problems as a result of that. > > > On Tuesday, March 19, 2013 10:16:27 AM UTC-4, kwonilchang wrote: >> >> Hi @all! >> >> In my html-page I have a piechart. The data is grapped from a >> sqlite-database. The code for grabbing the data and printing the chart is >> organized in an extra js-file. In this file I load the google-APIs >> dynamically and on callback I draw the first chart on loading the website. >> So far, all is working fine. >> >> The js-code for doing that: >> >> >> function initLoader() { >> var script = document.createElement("**script"); >> script.src = >> "https://www.google.com/jsapi?**callback=drawFirstChart<https://www.google.com/jsapi?callback=drawFirstChart> >> "; >> script.type = "text/javascript"; >> document.getElementById('**header').appendChild(script); >> }; >> >> function drawFirstChart() { >> google.load("visualization", "1", {packages:["corechart"], "callback": >> initialize}); >> }; >> >> With initialize the chart is drawn. >> >> To manipulate the chart, the users can select from different values in a >> dropdown-list. When the new value is selected, there will be called a >> second method for updating the chart: >> >> >> function drawSecChart() { >> google.load("visualization", "1", {packages:["corechart"], "callback": >> initialize2}); >> }; >> >> >> This method causes an error "google not defined". Now, I am confused, >> because the API is allready loaded... >> >> How can I access "google"? Or is there another solution for that problem? >> >> Any hints would be usefull. >> >> Thanks! >> > -- > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
