动态加载ckeditor4

通过getScript动态加载ckeditor4的时候,不要加载完成就调用initCkEditor。
也就是代码不能写成

  $.getScript(contextPath + '/common/ckeditor410/ckeditor.js', function () { 
            initCkEditor()
        })

需要写成

  $.getScript(contextPath + '/common/ckeditor410/ckeditor.js', function () {
            //加载完后 不能立刻执行 如果立刻执行读取不到相应的对象信息
            setTimeout(function () {
              initCkEditor()
            }, 5)
        })

你可能感兴趣的:(ckeditor5)