window.onload is what I meant to suggest. Glad it works for you. You can, of course, move the contents of that handler out of the function, except for the google.load() call itself.
Since you are only loading the visualization library and its css files as late as possible, I don't think there is any thing more you can do to "optimize" it. I wouldn't worry about it if the page performs well in your experience. On Thu, Jul 2, 2015 at 11:58 AM, Viktor Ka <[email protected]> wrote: > document.onload = onloadHandler; > did not worked. Tried > > window.onload = function () { > google.load("visualization", "1", {packages: ["corechart"], callback: > drawCharts}); > > var t1 = 'IndexTitle' > var t2 = 'IndicatorTitle' > function drawCharts() { > drawChart1(t1); > drawChart2(t2); > } > } > > and it worked. Also, now I was able to change > > <script type="text/javascript" src="https://www.google.com/jsapi > "></script> > to > > <script type="text/javascript" src="https://www.google.com/jsapi" > async></script> > which pushed the Google PageInsite score from 49 to 82. Still Google page > insight shows > > Optimize CSS Delivery of the following: > https://www.google.com/…bdd6ab2d343a51d49841bf93d022fb/ui+en.css > https://ajax.googleapis.com/…static/modules/gviz/1.0/core/tooltip.css > > as I understand these CSS are loaded when > > google.load("visualization", "1", {packages: ["corechart"], callback: > drawCharts}); > is called. How do I optimize that? > > -- > 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.
