IE 中具有不同配置文件的多个 CKEDITOR 实例已损坏

发布于 2024-09-10 05:06:19 字数 594 浏览 0 评论 0原文

我试图将多个 CKEDITOR 实例放置在同一页面上,每个实例加载不同的配置文件。它在 FF 中工作正常,但在 IE 中,页面上最后一个实例的配置文件将应用于所有实例。每个实例都有一个唯一的基本元素名称。我使用以下代码来添加实例,并为每个实例更改 customConfig、宽度和高度值。

CKEDITOR.replace(   document.form1.elementName,
                                {
                                    customConfig : customConfigFile.js',
                                    width :   '500px',
                                    height: '200px'
                                }
);

我做错了什么?我不能只从页面上的配置文件中指定设置,因为配置文件的一部分是 oninstanceready 调用。我能够使其工作的唯一方法是使用 setTimeout 延迟每个实例的初始化,但这远非理想。有什么想法吗?

I'm trying to place multiple CKEDITOR instances on the same page, each one loading a different config file. It works fine in FF, but in IE the config file from the last instance on the page is applied to all instances. Each instance has a unique base element name. I'm using the following code to add the instances, with the customConfig, width, and height values changing for each instance.

CKEDITOR.replace(   document.form1.elementName,
                                {
                                    customConfig : customConfigFile.js',
                                    width :   '500px',
                                    height: '200px'
                                }
);

What am I doing wrong? I can't just specify the settings from the config files on the page, because part of the config file is an oninstanceready call. The only way I've been able to make it work is to delay the initialization of each instance using setTimeout, but this is far from ideal. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

橘和柠 2024-09-17 05:06:19

尝试将其放在页面底部的结束正文标记之后,因为必须先加载该元素,然后才能进行替换。您只需要配置文件的名称,而不需要其他论坛中建议的完整路径。我有同样的问题,这对我有用。不要忘记文件名之前需要一个起始引号:

CKEDITOR.replace(   'elementname',
   {
       customConfig : 'customConfigFile.js',
       width :   '500px',
       height: '200px'
   }
);

Try putting it at the bottom of your page after the closing body tag becuse the element has to be loaded before the replace can happen. And you only need the name of the config file not the full path as has been suggested in other forums. I had the same issue and that worked for me. Don't forget you need a starting quote before the name of the file:

CKEDITOR.replace(   'elementname',
   {
       customConfig : 'customConfigFile.js',
       width :   '500px',
       height: '200px'
   }
);
岁吢 2024-09-17 05:06:19

看起来 @Danny Cohn 也在 CKEditor 社区论坛< /a>.他在那里收到的“答案”并没有回答问题。

根据我的经验,当页面上的多个 ckeditor 每个都指定了自己的 customConfig 时,最后一个编辑器获胜,并且必须包含页面上其他编辑器(以及最后一个编辑器)的数据(例如工具栏)。 。

It looks like @Danny Cohn has also entered this question in the CKEditor community forum. The "answer" he received there didn't answer the question.

In my experience with this, when multiple ckeditors on a page each have their own customConfig specified, the last one in wins and must contain data (eg, toolbars) for the other editors on the page (as well as the last one) to work.

清风无影 2024-09-17 05:06:19

这是一个已知问题。

请参阅:http://dev.ckeditor.com/ticket/6504

This is a known issue.

See: http://dev.ckeditor.com/ticket/6504.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文