Gaurav, You should study the documentation about dynamic loading here: https://developers.google.com/chart/interactive/docs/library_loading_enhancements#enhancedloading which links to here: https://developers.google.com/loader/#Dynamic
Generally, you must not call any google.visualization function until the library has been loaded. Either google.setOnLoadCallback() or the callback property will do that, so you need to use one method or the other. But you can only call google.setOnLoadCallback() as the code is loading, so if the document is already loaded when you call google.load(), then you should use the callback property to find out when the library has finished loading. If you need to do other things that wait for the document to load or other libraries to load, or wait for user determined events, then your logic will be more complex. For all the things that need to be done before you can proceed, you need to either do them all in a predictable order, or if that cannot be done, check that they are all done before proceeding, and if not done, perhaps the best you can do is timeout and try again. I hope that helps. On Mon, May 11, 2015 at 12:31 PM, Gaurav Mohla <[email protected]> wrote: > I have read on a lot of blogs that setonload method doesnt work with > document.ready()..how does this method actually does its task. Without > understanding i cant go any further as I need to have an ajax call & > depending upon that call I need data from server dynamically. and I also > need document.ready for other jquery related stuff. Could you shed some > light on setonload function or any link from where i could have some > details upon this topic. > 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. > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 5CC, Cambridge MA [email protected] <[email protected]> 9 Juniper Ridge Road, Acton MA -- 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. For more options, visit https://groups.google.com/d/optout.
