2012-10-02 21 views
1

repaste我有我的textarea TinyMCE的編輯器清除編輯內容。我使用的往往是從字按鈕貼,我想清楚了編輯的內容時,我從文字repasting。TinyMCE的:當從字

你有關於如何做到這一點的想法。

+0

你是什麼意思「清除編輯器的內容」?你想刪除所有以前的編輯器內容,並保持粘貼的東西在你的編輯器? – Thariama

+0

@Thariama,感謝您的回答。你是對的,那就是我需要的。我找到了一個效果很好的答案,我會把它解決。 –

回答

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); 
     } 
+1

是的,這是一個工作的解決方案+1 – Thariama

+0

非常感謝您@Thariama。 –