2

こんにちは、画面に CKeditor があります ckeditor が表示されていますが、エディターのインスタンスを取得しようとすると、null または undefined の値があります ckeditor インスタンスを取得するにはどうすればよいですか

function editor() {
    //i have null here
    for (name in CKEDITOR.instances) {
        CKEDITOR.instances[name].destroy()
    }

    var editor = CKEDITOR.instances.editor1;//i have null here
    editor.on('key', function () {
        var data = editor.getData();        
    });
}

$(document).ready(function () {    
    var editorShort = CKEDITOR.editor.replace('popup_editor1');
    editor();
});
4

2 に答える 2