javascript - Tinymce 未捕获错误:节点不能为空或未定义
问题描述
大家好,当我尝试调用我的函数来编辑触发我的 tinymce 的内容时,tinymce 出现错误,但我的控制台中有此错误
我用的是最后一个版本
tinymce.min.js:9 未捕获的错误:在 Object.vt [as fromDom] (tinymce.min.js:9) 处节点不能为空或未定义
我从这样的函数中调用我的 tinymce。
_this.tinymceContextMenu();
/**
* tinymce Context Menu
*/
tinymceContextMenu: function() {
if (_this.config.showContextMenu == false) {
return false;
}
var _toolBar = ''; //'fontselect fontsizeselect bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist | link | unlink removeformat',
if (_this.config.showContextMenu_FontFamily == true) {
_toolBar += 'fontselect ';
}
if (_this.config.showContextMenu_FontSize == true) {
_toolBar += 'fontsizeselect ';
}
if (_this.config.showContextMenu_Bold == true) {
_toolBar += 'bold ';
}
if (_this.config.showContextMenu_Italic == true) {
_toolBar += 'italic ';
}
if (_this.config.showContextMenu_Underline == true) {
_toolBar += 'underline ';
}
if (_this.config.showContextMenu_Strikethrough == true) {
_toolBar += 'strikethrough ';
}
if (_this.config.showContextMenu_Hyperlink == true) {
_toolBar += 'link ';
}
console.log(tinymce);
//default options
_toolBar += ' | alignleft aligncenter alignright alignjustify | bullist numlist | forecolor backcolor | unlink removeformat ';
tinymce.init({
selector: '.email-editor-elements-sortable',
menubar: false,
inline: true,
toolbar: false,
plugins: [
'autolink',
'codesample',
'link',
'lists',
'media',
'quickbars',
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table paste imagetools wordcount"
],
quickbars_selection_toolbar: 'bold italic underline | undo redo | fontselect fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignfull | link image',
// quickbars_insert_toolbar: 'styleselect | quicktable image'
});
},
解决方案
推荐阅读
- crystal-reports - 如何在现有的水晶报表公式中添加秒?
- django - 在 Django 中扩展 AbstractUser 模型
- bash - 为什么即使两个 elif 语句相似,它们的行为也会不同?
- visual-studio-2017 - SSMS 和 Visual Studio 仅以管理员身份运行
- java - 如何发送具有 Flux/Mono 属性的类的 ResponseEntity 的 Mono
- python - 在 Featuretools 错误 TypeError 中创建实体集:“str”对象不支持项目分配
- c# - 使用 AutoMapper 协助迭代对象
- python - 如何更改 iopub_data_rate_limit = 10000000 的设置?
- sql - 如何构建来自 plsql 的 json 请求?
- javascript - 是否有技术或代码风格的原因不命名您的 IIFE 函数?