ckeditor: “a is undefined”

走远了吗. 提交于 2019-12-06 23:01:35

问题


I just added CKEditor to my website, but I'm getting the following error in my console:

I followed the installation guide as it's written so I have no idea what's wrong.

Here's, briefly, 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>

回答1:


Aah.. try this

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

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

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



回答2:


This also happened whenever we put initializer script before <textarea>.

Ensure to put

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

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




回答3:


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

Please add above code in external js file and include this js in html page after title page like

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



回答4:


This also happened whenever we put initializer script before . Ensure to put

CKEDITOR.replace( 'editor1' );

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




回答5:


This append to me because i was trying to use CKEDITOR.replace("editor") but there was no element in dom with Id or name "editor"




回答6:


The issue for me was I copied the code locally from the cdn so that I can work on it if I am not online. I am using version 4.9.2 standard. Examining the chrome console gave several 404 errors which were not obvious using FireFox. Reverting back to the cdn resolved the issue. Unfortunately, no working offline with this it seems at least not for this version of ckeditor.



来源:https://stackoverflow.com/questions/26597939/ckeditor-a-is-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!