Awesome, thanks! Yeah thinking about it now, it makes sense that it always would have been async, but I guess like you said, we were just lucky previously. I was able to work in the proper callback to prevent my scripts running before the library loads, and all should be good now.
On Wednesday, July 13, 2016 at 8:19:35 PM UTC-4, Daniel LaLiberte wrote: > > The callback is the clever way to ensure that non of your charts-dependent > javascript runs until the library is loaded. You might want to use the > 'callback' property on your google.charts.load() call instead of using the > separate setOnLoadCallback method. > > The library loading has always been asynchronous. If it worked before for > you without using the callback, you were just lucky. It could appear to > work faster if you have previously loaded the library into your browser > where it is cached for faster loading the next time. > > On Tue, Jul 5, 2016 at 12:40 PM, Evan Koch <[email protected] > <javascript:>> wrote: > >> Just recently, we converted our website to use the new library loading >> procedures outlined in the documentation (from google.load('visualization') >> to google.charts.load) >> >> As soon as the page loads, we have javascript firing that uses the google >> charts library. We have the call to load the library within the <head> tag. >> >> Previously, we never had issues with synchronization. If we did >> google.load('visualization', '1.0', 'packages': { ['corechart'] }); by the >> time we go to our javascript, it would execute properly with no exceptions. >> Now that we're using the current library loading procedure, we're getting >> errors at runtime which suggest the visualization library is still loading >> by the time our javascript runs. >> >> Is the library loading method asynchronous? I couldn't find anything >> explicitly in the documentation that said so, though it seems like it is, >> and that makes sense. I realize there is a feature to use a callback, which >> is nice as you're waiting for the library to load, but I was curious if >> there was any way to override that call to make it synchronous? >> >> Additionally, if any users have come across a clever way to ensure that >> none of your charts-dependent javascript runs until that library is loaded, >> that would be helpful. I'm not quite sure what our best approach is going >> to be, but I'm trying to blend our already-working code into this new >> library feature. >> >> -- >> 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] >> <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at >> https://groups.google.com/group/google-visualization-api. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/google-visualization-api/1a96bbd6-a250-42f4-a520-4886b821e157%40googlegroups.com >> >> <https://groups.google.com/d/msgid/google-visualization-api/1a96bbd6-a250-42f4-a520-4886b821e157%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > [email protected] <javascript:> 5CC, Cambridge 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 https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/3165d379-0249-4ebc-b541-76a7ca12bb4e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
