TinyMCE 4 - remove() or destroy()

后端 未结 15 596
抹茶落季
抹茶落季 2020-12-25 12:22

I am using TinyMCE editor. I want to remove or destroy tinymce editors (Page contain more then one editor). Also remove classes and IDs added by tinyMCE.

Bu

相关标签:
15条回答
  • 2020-12-25 12:55

    If you have multiple Instances of TinyMCE you can use following code snippet to close every instance of TinyMCE:

    for (var i = tinymce.editors.length - 1 ; i > -1 ; i--) {
        var ed_id = tinymce.editors[i].id;
        tinyMCE.execCommand("mceRemoveEditor", true, ed_id);
    }
    

    I use it before the Ajax Content is loaded.

    0 讨论(0)
  • 2020-12-25 13:02

    When using the tiyMCE.init({}) fuction, the answer by @nikmauro works for me, so for every unload of the page, you just trigger the tinymce.get("real_element_id").remove();

    That method works for me.

    BTW, I amusing this version

    //tinymce.cachefly.net/4.1/tinymce.min.js 
    
    0 讨论(0)
  • 2020-12-25 13:02

    By simply using this you can remove TinyMCE editor:

    tinymce.remove('#your_textarea_id');
    
    0 讨论(0)
提交回复
热议问题