我的页面上有一个内联CKeditor,它运行正常。它在更新后发布了AJAX,一切都很棒。
然而,在控制台中我收到错误"未捕获的ReferenceError:未定义CKEDITOR"
当我尝试修改javascript中的工具栏时,我发现了这一点,但工具栏并没有改变。
这里有什么想法?
<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>
这在body标签之前调用...
<script src="assets/js/ckeditor/ckeditor.js"></script>
<script src="assets/js/ckeditor/adapters/jquery.js"></script>
答案 0 :(得分:2)
移动
<script>
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline('editor<?php echo $sub_category['id'] ?>');
</script>
之后
<script src="assets/js/ckeditor/adapters/jquery.js"></script>
因为您必须先加载ckeditor.js
库,然后使用CKEDITOR
方法/属性配置它