Search code examples
angularjshtmlgoogle-visualizationinternet-explorer-9

Object doesn't support property or method atob


 <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
 <script type="text/javascript">
  google.charts.load('current', {packages: ['corechart', 'line']});
  google.charts.setOnLoadCallback(drawChart);
  </script>

I have loader.js in my libraries folder for google charts but I get the error:"Object doesn't support property or method atob" in IE9. I have done crtF on 'atob' and I could only find it in the loader.js which looks like Z.global.atob.

How can you use google charts in IE9?


Solution

  • Judging from the error message, the loader.js script requires the atob function to be present on the global object (window in browsers).

    It was added in IE10 so with IE9 it is not found.

    You can work around the issue by adding a polyfill for atob and btoa.

    I tried this one and worked like a charm for me:

    https://github.com/davidchambers/Base64.js