Colorbox 中的 CKEditor 加载不起作用 [ Google Chrome ]

2024-01-31

我在我的项目中使用 Colorbox。我已将 CKEditor 集成到 colorbox 中。它在所有浏览器中工作正常,但在 Google Chrome 中存在一个小问题 - 编辑器将在第一次单击时正确打开,关闭弹出窗口并在不加载页面的情况下第二次尝试编辑器,我无法在编辑器中输入文本,单击源代码即可启用编辑器。我没有在基本编辑器中使用源工具栏。

我花了超过 5 天的时间来寻找此问题的解决方案,并尝试其他人的帮助 - 还没有结果。期待更好的反馈...

提前感谢您的帮助。

我为此设置了一个测试代码...... 索引1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="../ckeditor/_samples/jquery-1.5.1.min.js"></script>
        <script src="colorbox/jquery.colorbox-min.js"></script>
        <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>
        <script src="../ckeditor/_samples/sample.js" type="text/javascript"></script>

        <link rel="stylesheet" href="colorbox.css" />
        <link href="../ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('a.gallery').colorbox({ opacity:0.5 });
            });
        </script>

        <style type="text/css">

        </style>
    </head>
    <body>
        <a class='gallery' href='index2.html' style="font-size: 30px;">click here for editor</a>
    </body>
</html>

索引2.html

<textarea name="ckeditor_replace" id="ckeditor_replace" class="ckeditor_replace"></textarea>
<script type="text/javascript">
    $(document).ready( function() { // I use jquery
        var instance = CKEDITOR.instances['ckeditor_replace'];
        if(instance)
        {
            CKEDITOR.remove(instance);
        }
        //CKEDITOR.config.startupFocus = true;
        //CKEDITOR.config.startupShowBorders = false;
        //CKEDITOR.config.startupOutlineBlocks = true;
        //CKEDITOR.config.startupMode = 'source';
        $( '.ckeditor_replace' ).val('12345');
        $( '.ckeditor_replace' ).ckeditor(function() {  } );
    });
</script>

问候 尼沙德·阿利亚尔


我得到了相同的解决方案,只需在index2.html中包含jquery和jquery适配器即可。请参阅下面的示例...

索引1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript" src="../ckeditor/_samples/jquery-1.5.1.min.js"></script>
        <script src="colorbox/jquery.colorbox-min.js"></script>
        <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
        <script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>
        <script src="../ckeditor/_samples/sample.js" type="text/javascript"></script>

        <link rel="stylesheet" href="colorbox.css" />
        <link href="../ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />

        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('a.gallery').colorbox({ opacity:0.5 });
            });
        </script>

        <style type="text/css">

        </style>
    </head>
    <body>
        <a class='gallery' href='index2.html' style="font-size: 30px;">click here for editor</a>
    </body>
</html>

索引2.html

<script type="text/javascript" src="../ckeditor/_samples/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>

<textarea name="ckeditor_replace" id="ckeditor_replace" class="ckeditor_replace"></textarea>
<script type="text/javascript">
    $(document).ready( function() { // I use jquery
        var instance = CKEDITOR.instances['ckeditor_replace'];
        if(instance)
        {
            CKEDITOR.remove(instance);
        }
        //CKEDITOR.config.startupFocus = true;
        //CKEDITOR.config.startupShowBorders = false;
        //CKEDITOR.config.startupOutlineBlocks = true;
        //CKEDITOR.config.startupMode = 'source';
        $( '.ckeditor_replace' ).val('12345');
        $( '.ckeditor_replace' ).ckeditor(function() {  } );
    });
</script>

Regards

尼沙德·阿利亚尔

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Colorbox 中的 CKEditor 加载不起作用 [ Google Chrome ] 的相关文章

随机推荐

  • 如何从内容页访问母版页中的用户控件?

    假设我在母版页中有一个标头用户控件 并且想要根据母版页内加载的内容页来更改用户控件的属性 我该怎么办 Thanks 您可以使用两种方法 第一个是通过使用Page Master FindControl controlID 然后您可以将其转换为
  • 查找嵌套 json 对象深处的对象

    我在下面的代码片段中有嵌套的 json 对象 想要查找所有出现的 schema 并将包含该架构值的整个对象保存到另一个对象中 我尝试使用 lodash 过滤器 但没有成功 有没有人有什么建议 element parseResult cont
  • 预授权不起作用

    我正在编写一个套接字服务器 无 Web 应用程序 应用程序 并希望使用基于方法的安全性来处理我的 ACL 需求 我按照我发现的一个小教程进行操作春季安全举例 http blog solidcraft eu 2011 03 spring se
  • 为什么我不能使用“scanf_s”同时读取字符和数字?

    这段代码崩溃了 scanf s c d ch x Run error 但这段代码有效 scanf s c ch scanf s d x Run succeed 我想知道为什么第一个代码片段是错误的 运行错误 的意思是 当我运行程序输入时 编
  • 返回 false 不停止表单提交

    我很确定这应该不会那么难 我有一个在提交时运行以下函数的表单 function FORMVALIDATE add rota entry var rota date rota date val var rota id rota id val
  • 自定义 Slack 机器人无法连接

    我一直在尝试制作一个 Slack 机器人 它可以回复简单的查询并做一些简单的事情来帮助办公室工作 该机器人工作正常 只是似乎无法从我们的代理后面连接到 Slack 当我从自己的移动互联网连接测试它时 它工作正常 但是当尝试在代理后面运行它时
  • Android 此功能需要 ASM7

    可能重复 https stackoverflow com questions 68709559 nestmember requires asm7 noredirect 1 我已将 Android Studio 更新为 Android Stu
  • 使用 automake 安装包含大量文件的数据目录树

    我有一个数据目录 我希望 automake 为其生成安装和卸载目标 本质上 我只想将此目录逐字复制到 DATA 目录 通常 我可能会单独列出所有文件 例如 dist whatever DATA dir subdir filea 但是当我的目
  • 如何在 spring Restapi 的 json 请求中的未知字段上抛出错误

    我有一个 spring Rest api 它获取 json 数据并绑定到 pojo GetData 每当我收到未知字段时 它都不会失败或抛出任何异常 我的要求是当它接收到 json 数据中的未知字段时应该抛出错误 public Respon
  • 如何实现 ILogger 将消息发送到 SignalR Hub?

    我想构建一个显示最新日志消息的 LogView 所以我构建了一个非常简单的设置 但在依赖注入方面失败了 这是我的实施尝试 我跳过了非关键部分 public class SignalRLogger ILogger private readon
  • 使用 Java 删除 JIRA 中的问题

    我正在尝试编写一种方法来删除 JIRA 中的问题 我已经有了创建和更新问题的方法 但我找不到任何有关如何使用 Java 删除问题的文档 如何从 Java 应用程序中删除 JIRA 问题 您可以尝试从 IssueService 中删除 htt
  • 如何限制谁可以 iframe 嵌入我的网络应用程序?

    限制 Web 应用程序可以嵌入 iframe 的网站的最佳 最安全 方法是什么 例如 所有不在名单上的人都应该被拒绝 www myFriend com www anotherfriend com www myThirdFriend com
  • 我应该使用什么类型来表示 C 枚举的二进制?

    据我所知 C 枚举是无符号整数 但这可能因实现而异 我应该为二进制表示形式的枚举使用什么类型 附注 二进制表示 是指字节数组 我想将枚举值序列化到套接字以与其他程序进行互操作 由编译器决定是否使用int代表一个enum类型 或一个long
  • Quartz.NET 服务器文档

    下载 Quartz NET 时 它包含一个带有控制台应用程序的服务器组件 网站 常见问题解答和 API 文档没有提及任何相关内容 有人知道更多关于它的信息或者知道我在哪里可以找到更多关于它的文档吗 谢谢 帕特里克 那么你可以加入Quartz
  • 在哪里可以找到使用 C# /// xml 文档注释的好示例? [关闭]

    Closed 此问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我正在寻找 NET XML 样式源代码注释和所有可用的各种标签的一些很好的示例 我在哪里可以找到一些好的
  • 如何使用 Windows + WSL2 在 Pycharm 中配置 Poetry 环境?

    TL DR 无法使用 WSL 中的现有 Poetry 环境在 PyCharm Windows 上配置 Python 解释器 当尝试设置 Poetry 环境路径时Add Python Interpreter gt Poetry Environ
  • GAE:使用 testbed 和 webtest 测试 blob 的下载

    我将 blobstore 与我的 Google App Engine 应用程序一起使用 并且在生产服务器和开发服务器上一切正常 使用测试台进行测试和webtest http webtest pythonpaste org 但是 不起作用 在
  • 检查 Discord 机器人是否在线

    我试图做到这一点 以便我的机器人一次只能连接到 Discord 而另一个仅在另一个未连接时才连接 我怎样才能做到这一点 我在用着不和谐 py https pypi org project discord py 另外 如果可能的话 我希望它能
  • 创建和使用带有代理对的字符串

    我必须使用上面的代码点0FFFF 特别是数学脚本字符 并且尚未找到有关如何执行此操作的简单教程 我希望能够 a 创建Strings 具有高代码点 并且 b 迭代其中的字符 自从char不能保留这些点我的代码如下所示 Test public
  • Colorbox 中的 CKEditor 加载不起作用 [ Google Chrome ]

    我在我的项目中使用 Colorbox 我已将 CKEditor 集成到 colorbox 中 它在所有浏览器中工作正常 但在 Google Chrome 中存在一个小问题 编辑器将在第一次单击时正确打开 关闭弹出窗口并在不加载页面的情况下第