我正在尝试在我的基于 codeigniter 的网站上安装 CKEditor,并且我遵循了本教程:CKEditor in Codeigniter Tutorial
但是我收到这个错误:TypeError: c[a] is undefined
CKEDITOR.lang.load/d() ckeditor___ckeditor:230
CKEDITOR.scriptLoader</<.load/f() ckeditor___ckeditor:231
CKEDITOR.scriptLoader</<.load/x() ckeditor___ckeditor:231
CKEDITOR.scriptLoader</<.load/A() ckeditor___ckeditor:231
CKEDITOR.scriptLoader</<.load/u/g.$.onerror()
ckeditor文件夹所在的文件夹:assets/js/(即:assets/js/ckeditor/)
CKEDITOR_BASEPATH 是 CKEDITOR_BASEPATH = 'http://localhost:5678/assets/js/ckeditor/';
我不知道这个错误是什么,也找不到正确的答案或修复它。
提前致谢。
最佳答案
我有同样的问题。 CKEditor 没有正确识别它自己的文件夹。 所以你应该在加载 CKEditor 之前设置一个 CKEDITOR_BASEPATH 变量。
这里简单说一下:(但可能还有其他地方解释得更好。) http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.basePath
因此实现将是这样的:
<script>
window.CKEDITOR_BASEPATH = 'http://example.com/path/to/libs/ckeditor/';
</script>
在我的例子中,我使用了 window.CKEDITOR_BASEPATH = '/app/storereport/ckeditor/';
然后加载主要的 ckeditor.js 脚本。
<script type="application/javascript"/>
$(document).ready(function (){
CKEDITOR.replace( 'product_content' ); // ID of element
});
</script>
关于javascript - CKEditor 类型错误 : c[a] is undefined in CodeIgniter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37013922/