Please see inline,
VizGuy

On Wed, Nov 26, 2008 at 8:10 PM, jago <[EMAIL PROTECTED]> wrote:

>
> Another question concerning
> http://code.google.com/apis/ajax/documentation/#Dynamic
>
> I guess I should  call initLoader() only once and from then on
> directly call loadMaps() as often as one wants. How do I best prevent
> the code to call initLoader() more then once (e.g. initLoader() is
> called whenever the user presses a button)? Will it drastically slow
> down the loading process of a webpage if I directly include the script
> initLoader() contains in the header of the page, so it is loaded right
> away. Or should I call initLoader() in a pageload-callback?
>

Including the api loading in the header will not drastically slow the page
loading.
Yet, it might be a bit slower than not including it.
I guess it depends on if you are sure you will use it.
You can load the jsapi script in the first loading, and then load the
visualization api later.
It is up to you, eventually. Loading more code in the initial loading slows
the first time you see the page, naturally.

>
> How do I 'Make sure the DOM is ready when you call google.load with
> the callback option because it will try to append an element to the
> DOM'. ?

You can use the page onLoad event. See more on this in many places in the
web.


>
>
> What means the key parameter in: script.src = "http://www.google.com/
> jsapi?key=ABCDEFG&callback=loadMaps<http://www.google.com/jsapi?key=ABCDEFG&callback=loadMaps>";
> ?
>
This is related to the maps api. Please read about it in the maps api docs.
In general, this is a developer key that you have to register for (free of
charge).




>
>
> Thanks,
> jago
>
>
> On Nov 25, 9:28 pm, VizGuy <[EMAIL PROTECTED]> wrote:
> > This is possible,Please have a look athttp://
> code.google.com/apis/ajax/documentation/#Dynamicto see how you can
> > load the api later after the page is loaded.
> > Please note that as explained there, you need to use a callback parameter
> > rather than calling setOnLoadCallback function, as the onload event will
> not
> > be fired at that time.
> >
> > While the example in that page is with the maps api, the concept is the
> > same.
> >
> > Please let me know if this helps.
> > VizGuy
> >
> > On Tue, Nov 25, 2008 at 6:50 PM, jago <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > The Google Javascript library and Viz-lib are always loaded at the
> > > beginning on the Html code.
> >
> > >    <script type="text/javascript" src="http://www.google.com/jsapi";></
> > > script>
> > >    <script type="text/javascript">google.load("visualization", "1",
> > > {packages:["annotatedtimeline"]});</script>
> >
> > > Could I load a Html page without any libraries loaded - and only later
> > > by pressing a button modify the DOM of the page in such a way that
> > > only then the necessary Google libraries are loaded and the drawChart
> > > () function residing in the code is executed?
> >
> > > Could somebody be so kind a write a short example? I am a Javascript
> > > beginner and although I tried for hours now, all my tests failed.
> >
> > > Cheers,
> > > jago
> >
>

--~--~---------~--~----~------------~-------~--~----~
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