Yes, its not exactly clear from the docs. I've had the same problem. As far as I can tell, it just installs a window.onload handler (using addEventListener, or attachEvent if available). So yes, you should be able to rely on the dom being loaded. But since its not really specified, I've ended up using some other method, such as jQuery's $ (document).ready function rather than rely on setOnLoadCallback.
Mark On Dec 2, 10:54 am, codingGirl <[email protected]> wrote: > Hi, > > google.setOnLoadCallback(myFunction) > > can somebody explain to me what exactly this function does internally? > Does it wait until the Google API is loaded and then directly executes > myFunction? Or does it wait until the API and all of the page/DOM is > loaded before it calls: myFunction? > > Since myFunction may access the DOM this would require > google.setOnLoadCallback to call myFunction AFTER the DOM is fully > loaded, doesn't it? > > Is there a JS function I could use to replace > google.setOnLoadCallback? and I don't mean <body onload="..."> -- 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.
