{"id":489,"date":"2022-08-30T15:02:12","date_gmt":"2022-08-30T15:02:12","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/ckeditor-instance-is-null-or-undefined-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:02:12","modified_gmt":"2022-08-30T15:02:12","slug":"ckeditor-instance-is-null-or-undefined-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/ckeditor-instance-is-null-or-undefined-collection-of-common-programming-errors\/","title":{"rendered":"CKeditor instance is null or undefined?-Collection of common programming errors"},"content":{"rendered":"<p>It could be that the instances variable is simply undefined at that time. Depending on what you really want to do with the editor, I suggest that you do the on key bindings and other such things inside instanceReady, which is a CKEditor event.<\/p>\n<pre><code>$(document).ready(function () {  \n    \/\/ You can define it before replacing the editor\n    CKEDITOR.on('instanceReady', function(evt){\n        \/\/ Do your bindings and other actions here for example\n        \/\/ You can access each editor that this event has fired on from the event\n        var editor = evt.editor;\n    });\n\n   \/\/ replace editor\n    var editorShort = CKEDITOR.editor.replace('popup_editor1');\n});\n<\/code><\/pre>\n<p>See the documentation at http:\/\/docs.ckeditor.com\/#!\/api\/CKEDITOR-event-instanceReady<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:45:42. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>It could be that the instances variable is simply undefined at that time. Depending on what you really want to do with the editor, I suggest that you do the on key bindings and other such things inside instanceReady, which is a CKEditor event. $(document).ready(function () { \/\/ You can define it before replacing the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-489","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=489"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/489\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}