Using jQuery to grab the content from CKEditor's iframe

前端 未结 11 1610
既然无缘
既然无缘 2020-11-29 01:20

I have a custom-written CMS that uses CKEditor *(FCKEditor v3) for editing content. I\'m also using the jQuery Validation plugin to check a

11条回答
  •  迷失自我
    2020-11-29 02:08

    The contentDom event worked for me and not the instanceReady... I would really like to know what the events ae, but I assume they are proprietary...

    var editor = CKEDITOR.replace('editor');
    
    CKEDITOR.instances.editor.on("instanceReady", function(){
        this.on('contentDom', function() {
            this.document.on('keydown', function(event) {
                CKEDITOR.tools.setTimeout( function(){ 
                    $(".seldiv").html(CKEDITOR.instances.editor.getData()); 
                }, 1);
            });
        });
        this.on('contentDom', function() {
            this.document.on('paste', function(event) {
                CKEDITOR.tools.setTimeout( function(){ 
                    $(".seldiv").html(CKEDITOR.instances.editor.getData()); 
                }, 1);
            });
        });
        edits_clix();
        var td = setTimeout("ebuttons()", 1);
    })
    

提交回复
热议问题