问题
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