对象不支持 属性 或方法 atob

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>

我的 google 图表的库文件夹中有 loader.js,但在 IE9 中出现错误:"Object doesn't support property or method atob"。我在 'atob' 上完成了 crtF,但我只能在看起来像 Z.global.atob.

的 loader.js 中找到它

如何在 IE9 中使用 google 图表?

根据错误消息判断,loader.js 脚本需要 atob 函数出现在全局对象上(在浏览器中为 window)。

它是在 IE10 中添加的,所以在 IE9 中找不到它。

您可以通过为 atobbtoa 添加一个 polyfill 来解决这个问题。

我试过这个,对我来说很有魅力:

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