簡體   English   中英

Tinymce 未捕獲錯誤:節點不能為空或未定義

[英]Tinymce Uncaught Error: Node cannot be null or undefined

大家好,當我嘗試調用我的函數來編輯觸發我的 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' }); },

您正在使用內聯編輯器,因此請嘗試為工具欄創建一個容器:

inline: true,
fixed_toolbar_container: "#my_div_for_toolbar",

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM