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? 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'. ? What means the key parameter in: script.src = "http://www.google.com/ jsapi?key=ABCDEFG&callback=loadMaps"; ? 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 -~----------~----~----~----~------~----~------~--~---
