The loader at  https://www.gstatic.com/charts/loader.js is really just the
top-level loader that then redirects to another loader based on which
version you are loading as specified with your google.charts.load call.  So
you are not escaping the dynamic loading of code by downloading the
top-level loader.  Also, the top-level loader does get updated from time to
time, at least every time there is a new release, and so it is not a good
idea to save your own copy of it.  The support for loading '1.1' was added
fairly recently, actually, so if your copy is older, that would explain the
failure.

On Thu, Aug 20, 2020 at 12:11 AM [email protected] <
[email protected]> wrote:

> Hi,
> I have downloaded https://www.gstatic.com/charts/loader.js in my project
> as lib file to avoid calling JS script dynamically on the fly.
>
> I used below code to generate timeline visualization,
> <script type="text/javascript" src="../lib/loader.js"></script>  --
> (static lib folder path in my src code)
> <script>
> google.charts.load('1.1', {packages: ['timeline']});
> google.charts.setOnLoadCallback(drawChart);
> </script>
> But in console, I am getting Bad version error.
>
> Uncaught (in promise) Error: Bad version: 1.1
>     at loader.js:133
>
> When I use below code, it works perfectly.
> <script *src="https://www.gstatic.com/charts/loader.js
> <https://www.gstatic.com/charts/loader.js>"*></script>
> <script>
>   google.charts.load('current', {packages: ['timeline']});
>   google.charts.setOnLoadCallback(drawChart);
> </script>
>
> Please let me know how to resolve this.
>
> Thanks,
> Shyam
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/8727abca-e4a0-4d54-99bf-635b87e2554an%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/8727abca-e4a0-4d54-99bf-635b87e2554an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   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 view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJN%3D%3DzfGGYfXtfu15pvZmw8fqinbf8j7LEfNK4g-%3D5eWTA%40mail.gmail.com.

Reply via email to