我正在使用 Google Charts API 构建示例幻灯片应用程序,每张幻灯片都有一些不同的图形。
但是,当在树莓派上运行一段时间后,浏览器(Mozilla)会显示下一个错误:
loader.js 文件位于 gstatic.com 上,但我已将其下载到我的主机上,但错误仍然存在。有人可以帮助我吗?
更多信息:
每张幻灯片均使用 Ajax 和 PHP 单独加载。每次 Ajax 加载时,脚本都会加载图形代码,但我在我的设备上调用一次 google.charts.load('current', {'packages':['corechart']});
方法主页。
最佳答案
我今天也遇到了这个错误消息:
Warning: Unresponsive script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: https://www.gstatic.com/charts/loader.js line 138 > eval:187
虽然我无法看到您的其余代码来确认它是否出于完全相同的原因而发生,但我建议您检查您在其中绘制图表的容器的 ID。
例如,这是我的 JavaScript 代码,其中包含有问题的行:
var chart = new google.visualization.PieChart(document.getElementById('chart'));
这是我的 HTML:
<div id="chart"></div>
仅使用名称 chart
作为图表容器元素的 ID 会使 loader.js 陷入无限循环。
关于javascript - Google 图表 - 第 138 行 loader.js 繁忙时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38837353/