问题描述
大家好,你好吗?我将使用 CKEDITOR 代码添加文本编辑器栏,一切正常,但问题是当我点击编辑器 复制和过去 按钮时它给了我这样的错误
按 Ctrl+V 进行粘贴。您的浏览器不支持使用工具栏按钮或上下文菜单选项粘贴。
按 Ctrl+Shift+V 进行粘贴。您的浏览器不支持使用工具栏按钮或上下文菜单选项粘贴。
按 Ctrl+V 进行粘贴。您的浏览器不支持使用工具栏按钮或上下文菜单选项粘贴。
谁能告诉我我能做些什么来解决这个错误,当我点击文本编辑器按钮时它开始工作,最后我想在图片中显示错误,所以下面的图片是错误,也许你看到错误图就很容易理解了
<!DOCTYPE html>
<html>
<head>
<Meta charset="utf-8">
<title>Editor Example</title>
<script src="https://cdn.ckeditor.com/4.10.1/standard/ckeditor.js"></script>
</head>
<body>
<textarea name="text_editor"></textarea>
<script>
CKEDITOR.replace( 'text_editor' );
</script>
</body>
解决方法
试试这个代码
CKEDITOR.on("instanceReady",function(event) {
event.editor.on("beforeCommandExec",function(event) {
// Show the paste dialog for the paste buttons and right-click paste
if (event.data.name == "paste") {
event.editor._.forcePasteDialog = true;
}
// Don't show the paste dialog for Ctrl+Shift+V
if (event.data.name == "pastetext" && event.data.commandData.from == "keystrokeHandler") {
event.cancel();
}
})
});