Failed to initialize the editor as the document is not in standards mode.

Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.

Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.

问题描述

最近在自己项目中使用上次学到的 Layui 使用 TinyMCE 富文本编辑器
突然发现不能正常渲染 TinyMCE 富文本编辑器
在这里插入图片描述
然后我调出开发者工具界面,感觉应该会有报错,果不其然,发现有一条报错(红色的,黄色的警告忽略):Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode.
在这里插入图片描述
翻译出来是:由于文档不在标准模式下,因此无法初始化编辑器。 TinyMCE需要标准模式。
在这里插入图片描述

问题解决

后来我在 TinyMCE 的论坛上发现有人碰到同样的问题,使用他提供的方法后,解决了该问题
在页面上添加:<!DOCTYPE html> 声明,且保证没有 http-equiv 属性
在这里插入图片描述
我在添加:<!DOCTYPE html> 声明之后,刷新页面,可以看到页面恢复正常了
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_35132089/article/details/107625177