php - Flot 不在 localhost 中显示图表
问题描述
我正在尝试使用 Flot 从 mysql 中查询一些数据来绘制图表。因为我以前从未使用过 Flot,所以我开始尝试重现 Flot 提供的示例,例如这个: http ://www.flotcharts.org/flot/examples/interacting/index.html
我在我网站的本地文件夹中下载了上面的 html 页面(并用 test.html 重命名),以及所有必要的 javascript 源和 CSS,并将它们放在同一个文件夹中,并更正了 html 页面中的路径以便找到js代码和css。
问题是,如果我用它的绝对路径打开这个 html 文件,图表可以完美运行:file:///data/www/test_website/test.html,但是如果我用 127.0.0.2/test 打开它就不行.html。
有人可以帮忙吗?任何建议将不胜感激!!!
我尝试绝对路径时没有错误。但是当我尝试使用 127.0.0.2/test.html 时,出现以下错误:
jquery.canvaswrapper.js:17 Uncaught TypeError: Cannot read property 'getElementsByClassName' of undefined
appContent.js:54 Uncaught (in promise) TypeError: Cannot read property 'query' of undefined
解决方案
推荐阅读
- subnet - 谷歌云数据融合子网问题
- oauth - 如何使 Google OAuth 应用程序的后端服务器接收“删除访问”事件或其他事件,例如“帐户禁用”、“令牌撤销”
- python - 如何修复:TypeError: relplot() 在使用 seaborn 绘制线图时获得了参数“x”的多个值
- asp.net-core - EF Core 一对一 - 仅针对一条记录返回结果
- turing-machines - 如何从 alpabet 创建机器
- python - 在拟合 multibomialNB 模型时,“int”和“str”实例之间不支持“<”
- excel - 加权平均反向
- javascript - 将 fetch api 调用存储为局部变量的函数(不是承诺)
- c++ - 与多个 for 循环相关的性能与从 multimap 获取数据的单个 for 循环相关的性能
- javascript - 无法在 Audio.playnxt 读取未定义的属性“NaN”