我正在尝试在我的网络服务器上加载highstocks文件,当我使用
时<script src="https://code.highcharts.com/stock/highstock.js"></script>
它完全正常,但在我的服务器上我尝试加载
<script src="highstocks/code/js/highstock.js"></script>
当它检查站点(您可以查看:weather.wesleyweisenberger.com)时,该链接指向正确的文件,但它不会加载高级图表。
我在highstocks文件夹中使用了chown -R
和chmod -R 755
,但我无法将该文件加载到网站中。尝试加载materialize或jQuery时遇到了类似的问题。
帮助将是Appreaciated。
答案 0 :(得分:0)
在您的情况下,进口顺序很重要。您需要在导出js行之前添加highstock导入行,如下所示
<!-- Import highcharts -->
<script src="highstocks/code/js/highstock.js"></script>
<!-- <script src="https://code.highcharts.com/stock/highstock.js"></script> -->
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
因为exports.js需要highstock.js,并且只有当您从本地添加时,订单才会错误,
<!-- Import highcharts -->
<!-- <script src="https://code.highcharts.com/stock/highstock.js"></script> -->
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
<script src="highstocks/code/js/highstock.js"></script> <!-- wrong order -->