html - 您的浏览器不支持使用工具栏按钮或上下文菜单选项进行粘贴
问题描述
大家好,你们好吗?我将使用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();
}
})
});
推荐阅读
- python - Tkinter 窗口在 anaconda 下打开为黑色
- swift - 为什么从 Float 铸造的 CGFloat 不表现出 CGFloat 行为?
- node.js - Node.js SyntaxError:设置 Forge 查看器时出现意外标识符
- docker - 如何让两个运行烧瓶服务和 golang 服务的 docker 容器相互通信?
- java - ContextWrapper.registerReceiver() 函数如何动态注册接收者?
- python - IndexError:列表索引超出范围/ Facenet
- git - smartgit上分支窗口中的箭头
- sql - 编写查询以从表 A 派生表 B
- firebase - Flutter firebase_messaging iOS应用程序在前台应用程序时未收到推送通知
- node.js - 为什么console.log在nodejs的app.js中出现两次