Uncaught Error: Graph container element not found

柔光的暖阳◎ 2022-03-22 05:45 372阅读 0赞

网上下载了一个后台模板,然后出现这个报错。

特别注意:不解决这个报错,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. (custom-scripts.js:197)
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)

图片版:

20190126121931508.png

错误如上图

产生这个的原因,是你再js文件中创建了创建图片容器的代码,但是你对应的html页面上是没有或者缺少相对应的div!

解决方案:

1、只需要在js文件中注释掉没使用的创建容器代码即可。

2、想保留js代码,只需要在html页面中补全缺少的div就可以了。

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xrcDE2MDM2NDU3NTY_size_16_color_FFFFFF_t_70

注意,页面上创建div的ID记得设置为上图上标识的名字。

发表评论

表情:
评论列表 (有 0 条评论,372人围观)

还没有评论,来说两句吧...

相关阅读