我正在尝试将粘贴事件绑定到我的 jquery 文本编辑器,以便我可以粘贴为纯文本。我已将第二行添加到我的jquery-te-1.4.0.js
.
editor.attr("contenteditable","true").html(thisElementVal);
editor.attr("onPaste","$(this).bind('paste', function (e) { e.preventDefault(); var text = e.clipboardData.getData('text/plain'); console.log(text) });").html(thisElementVal);
由于某种原因,输出给出,
Uncaught TypeError: Cannot read property 'getData' of undefined
有人可以帮帮我吗?谢谢。+