Ckeditor: "a is undefined"

I just added CKEditor to my site, but I get the following error in my console:

http://i.imgur.com/p4c3J4E.png

I followed the installation guide as he wrote, so I don't know what happened.

Here, in short, what my call looks like:

<textarea id="full-editor" name="full-editor" rows="10" columns="6"></textarea> <script type="text/javascript"> CKEDITOR.replace('#full-editor'); </script> 
+6
source share
5 answers

Ah .. try this

Remove # from the selector inside CKEDITOR.replace('#full-editor');

According to the installation guide you shared, this is what you need

 CKEDITOR.replace('full-editor'); // NO #. You must have got confused with jQuery 
+10
source

This also happens whenever we place a script initializer before <textarea> .

Make sure that

 <script> CKEDITOR.replace( 'editor1' ); </script> 

before the </body> (i.e., the closing body tag).

+5
source

<script type="text/javascript"> CKEDITOR.replace('#full-editor'); </script>

Please add the above code to an external js file and include this js in the html page after the cover page, for example

 $(document).ready(function () {// save as like ckEditorInclude.js CKEDITOR.replace('#full-editor'); } <script src="Your folder path/ckEditorInclude.js" type="text/javascript"></script> 
+1
source

This is an addition to me because I tried to use CKEDITOR.replace ("editor") but there was no element in dom with Id or name "editor"

0
source

This also happened when we placed the script initializer earlier. Make sure that

 CKEDITOR.replace( 'editor1' ); 

before the </body> (i.e., the closing body tag).

-1
source

Source: https://habr.com/ru/post/977304/


All Articles