如何在Cloud9 Ace代码编辑器中禁用粘贴?
答
可以使用
stop = function(e) {
e.stopPropagation(); e.preventDefault(); console.log(e)
}
document.querySelector(".ace_editor").addEventListener("paste", stop, true);
或
editor.onPaste = function() { return ""; }