TinyMCE 4 - remove() or destroy()

后端 未结 15 688
抹茶落季
抹茶落季 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:47

    Fake a virgin website

    TinyMCE will check if its already loaded in window.scripts. If you remove the according entry TinyMCE will behave like it is a untouched document.

    function cleanTinyMCE() {
      for (var i=0; i < window.scripts.length; i++) {
        if (window.scripts[i].match('.*tinymce.*js.*')){
          delete window.scripts[i];
          return;
        }
      }
    }
    

提交回复
热议问题