1

我的 textarea 上有一个 tinyMCE 编辑器。我经常使用 word 中的粘贴按钮,当我从 word 中重新粘贴时,我想清除编辑器的内容。

你知道如何做到这一点。

4

1 回答 1

2

我找到了解决方案。在初始化 tinyMCE 时,我对 paste_postprocess 进行了验证:

        paste_postprocess : function(pl, o) {
        // Content string containing the HTML from the clipboard
        tinyMCE.activeEditor.setContent('');
        return tinymce.dom.Event.cancel(pl);
        }
于 2012-10-02T08:01:12.360 回答