如何防止tinyMCE的粘贴事件? [英] How can I prevent tinyMCE's paste event?

查看:341
本文介绍了如何防止tinyMCE的粘贴事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果编辑器当前内容的长度加上要粘贴的单词的长度超过指定的限制,我需要阻止tinyMCE的粘贴事件.我该怎么做?谢谢.

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.

推荐答案

我错了.我不需要阻止或禁用 tinyMCE 中的粘贴来执行此操作.我使用了他们的粘贴插件并在粘贴之前修改了内容.

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 = '';
      } 
}

这篇关于如何防止tinyMCE的粘贴事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆