如何使用 jQuery 服务发送 ckeditor 配置?

发布于 2024-10-08 13:19:55 字数 566 浏览 0 评论 0原文

我的服务已构建,并将配置变量发送到我的 js 文件: [['SpellChecker','-','Undo','Redo','-','Bold','Italic','Underline','NumberedList','BulletedList']]

上面分配给我的javascript像这样:

var config = "<?= stripslashes($_REQUEST['config']) ?>";

我可以很好地提醒配置: console.log(config) 确实发回了正确的数据...

但是,我的控制台中抛出了一个错误!:

v 未定义 [中断此错误] 变量 u=n.toolbox.toolbars,v=n.config.to...aximize','ShowBlocks','-','关于']];

如果我注释掉配置:

//CKEDITOR.config.toolbar = config;

一切正常,但配置不存在,当然......

My service is built and it is sending the config variable to my js file:
[['SpellChecker','-','Undo','Redo','-','Bold','Italic','Underline','NumberedList','BulletedList']]

The above is assigned to my javascript like so:

var config = "<?= stripslashes($_REQUEST['config']) ?>";

I can alert out the config just fine:
console.log(config) does send back the correct data...

However, I get an error thrown in my console!:

v is undefined [Break On This Error]
var
u=n.toolbox.toolbars,v=n.config.to...aximize','ShowBlocks','-','About']];

If I comment out the config:

//CKEDITOR.config.toolbar = config;

everything works fine but the configuration doesn't exist, of course...

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

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

发布评论

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

评论(2

朦胧时间 2024-10-15 13:19:55

已修复...噗噗噗噗

// Setup the configurations for this instance
CKEDITOR.config.toolbar = eval(config);

FIXED...PFFFFFFFFT

// Setup the configurations for this instance
CKEDITOR.config.toolbar = eval(config);
放低过去 2024-10-15 13:19:55
$(文档).ready(function(){
    $('.reply').click(
    函数(事件){
        // 事件点击关闭 默认
        event.preventDefault();
        // CK编辑器
        $(函数(){
            var config = {工具栏:[['粗体', '斜体', '-', '链接', '取消链接']]};
            //
            // DOM 类 = "cke"
            $('textarea.cke').ckeditor(function(){}, config);                
        });
        返回假;
    });
}); 
$(document).ready(function(){
    $('.reply').click(
    function(event){
        // Event click Off Default
        event.preventDefault();
        // CKEditor
        $(function(){
            var config = {toolbar:[['Bold', 'Italic', '-', 'Link', 'Unlink']]};
            //<?php /*echo"var config = {toolbar:[['Bold', 'Italic', '-', 'Link', 'Unlink']]};" ;*/ ?>
            // DOM class = "cke"
            $('textarea.cke').ckeditor(function(){}, config);                
        });
        return false;
    });
}); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文