CKEditor works - but get error "Uncaught ReferenceError: CKEDITOR is not defined"

11,923

Move

<script>
    CKEDITOR.disableAutoInline = true;
    CKEDITOR.inline('editor<?php echo $sub_category['id'] ?>');
</script>

after

<script src="assets/js/ckeditor/adapters/jquery.js"></script>

because you must load ckeditor.js library first and then configure it with CKEDITOR methods/properties

Share:
11,923
user3274489
Author by

user3274489

Updated on June 04, 2022

Comments

  • user3274489
    user3274489 almost 2 years

    I have an inline CKeditor on my page and it works fine. It posts AJAX after its been updated, all works great.

    However, in the console I get the error "Uncaught ReferenceError: CKEDITOR is not defined"

    I discovered this when I was trying to modify the toolbar in the javascript, but the toolbar wasn't changing.

    Any ideas what is going on here?

    <div id="editor<?php echo $sub_category['id'] ?>" contenteditable="true" class="contentz ckeditor" typeID="<?php echo $sub_category['id'] ?>">
    <?php if($sub_category['content']==""){ echo "Click here to add some content"; }else{ echo $sub_category['content']; } ?>
    </div>
    <script>
    
        // Turn off automatic editor creation first.
        CKEDITOR.disableAutoInline = true;
        CKEDITOR.inline('editor<?php echo $sub_category['id'] ?>');
    
    
    
    </script>
    

    This is called just before the body tag...

    <script src="assets/js/ckeditor/ckeditor.js"></script>
    <script src="assets/js/ckeditor/adapters/jquery.js"></script>