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.
    • 问题描述
    • 问题解决

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._第1张图片
然后我调出开发者工具界面,感觉应该会有报错,果不其然,发现有一条报错(红色的,黄色的警告忽略):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._第2张图片
翻译出来是:由于文档不在标准模式下,因此无法初始化编辑器。 TinyMCE需要标准模式。
Failed to initialize the editor as the document is not in standards mode._第3张图片

问题解决

后来我在 TinyMCE 的论坛上发现有人碰到同样的问题,使用他提供的方法后,解决了该问题
在页面上添加: 声明,且保证没有 http-equiv 属性
Failed to initialize the editor as the document is not in standards mode._第4张图片
我在添加: 声明之后,刷新页面,可以看到页面恢复正常了
Failed to initialize the editor as the document is not in standards mode._第5张图片

你可能感兴趣的:(Layui)