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
属性
我在 jsp 页面头部添加:<!DOCTYPE html>
声明之后
再刷新页面,就可以看到页面恢复正常了