How can I prevent tinyMCE's paste event?

扶醉桌前 提交于 2019-12-24 03:44:21

问题


I need to prevent the paste event of tinyMCE if the length of the current content of editor plus the length of the words to be pasted exceed the specified limit. How can I do it? Thank you.


回答1:


I was wrong. I dont need to prevent or disable paste in tinyMCE to do this. I used their paste plugin and modified the content before it is pasted.

function(pl, o) {
      ...

      if(len > limit) {
           o.content = '';
      } 
}



回答2:


I think it's better to use the paste_preprocess function.

It's a old question, but others may stumble on this problem.



来源:https://stackoverflow.com/questions/15016210/how-can-i-prevent-tinymces-paste-event

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!