Uncaught Error: Graph container element not found
网上下载了一个后台模板,然后出现这个报错。
特别注意:不解决这个报错,ajax都没法用。
morris.js Graph container element not found
文字版:
morris.js:103 Uncaught Error: Graph container element not found
at Area.Grid [as constructor] (morris.js:103)
at Area.Line [as constructor] (morris.js:740)
at new Area (morris.js:1327)
at Object.Area (morris.js:1320)
at Object.initFunction (custom-scripts.js:84)
at HTMLDocument.
at fire (jquery-1.10.2.js:3101)
at Object.fireWith [as resolveWith] (jquery-1.10.2.js:3213)
at Function.ready (jquery-1.10.2.js:3425)
at HTMLDocument.completed (jquery-1.10.2.js:3455)
图片版:
错误如上图
产生这个的原因,是你再js文件中创建了创建图片容器的代码,但是你对应的html页面上是没有或者缺少相对应的div!
解决方案:
1、只需要在js文件中注释掉没使用的创建容器代码即可。
2、想保留js代码,只需要在html页面中补全缺少的div就可以了。
注意,页面上创建div的ID记得设置为上图上标识的名字。
还没有评论,来说两句吧...