Handling CKEDITOR in "loaded" state
//If you want to execute your code when the API is fully loaded, use CKEDITOR.loaded event:
CKEDITOR.on( 'loaded', function( evt ) {
// your stuff here
} );
//If you want to execute your code when any new instance is ready, use CKEDITOR.instanceReady event:
CKEDITOR.on( 'instanceReady', function( evt ) {
// your stuff here
} );
//If you want to execute your code when a particular instance is ready, then use CKEDITOR.editor.instanceReady event:
CKEDITOR.replace( 'editor', {
on: {
instanceReady: function( evt ) {
// your stuff here
}
}
} );