• 异步load()加载 ckeditor 编辑器


    异步加载ckeditor 编辑器,注意事项:

    第一.CKEDITOR 未定义:js未加载ckeditor.js 

    解决方案:

    1.将 js文件放在父页面

    <script src="http://www.cnblogs.com/../Content/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="http://www.cnblogs.com/../Content/ckeditor/ckfinder/ckfinder.js" type="text/javascript"></script>

    2. 首次请求 生成编辑器,再次加载时,需要销毁上次生成的编辑器,重新 生成新的 编辑器

     <textarea  id="Content" rows="6" cols="10"></textarea>
        <script type="text/javascript">
    
            jQuery(function ()
            {
                 // 300 弹窗高调
                 LoadCk(300);
               
            });
    
            function LoadCk(hh)
            {
    
                //加载CKeditor
                //判定 Content 是否存在
                var editor;
                if (!CKEDITOR.instances.Content) {
                   
                    var editor = CKEDITOR.replace('Content', { height: 300 });
                    
    
                } else {
                    
                    addCkeditor("Content", hh);
                }
    
            }
          //新增CKEDITOR
            function addCkeditor(id, hh)
            {
                var editor2 = CKEDITOR.instances[id];
                //销毁编辑器 Content, 然后新增一个
                if (editor2) editor2.destroy(true);
                editor = CKEDITOR.replace(id, { height: hh });
                
            }
        </script>
    View Code

    参考:http://blog.sina.com.cn/s/blog_7795200201013cjt.html

    第二:lang.contextmenu.options' 为空或不是对象

    解决方案: 实质ckeditor js文件引用问题

    1.对官方ckeditor.js 进行修改,导致某些配置勿删

    2.ckeditor.js 路径是否正确

    第三: ckeditor.js文件配置详情

    参考 :http://blog.csdn.net/yangchaofeng1229/article/details/6723235

  • 相关阅读:
    dagScheduler
    elasticsearch映射
    elasticsearch数据结构
    spring boot 整合 elasticsearch 5.x
    spark快速开发之scala基础之5高阶函数,偏函数,闭包
    Halcon学习笔记2
    HALCON算子1
    Halcon学习笔记1
    ML-学习提纲2
    ML-学习提纲1
  • 原文地址:https://www.cnblogs.com/lei2007/p/3080303.html
Copyright © 2020-2023  润新知