与Meteor一起使用CKEditor
我正试着用Kekeditor和meteor 首先,我添加了包 然后我添加了以下代码: route.js与Meteor一起使用CKEditor,meteor,ckeditor,Meteor,Ckeditor,我正试着用Kekeditor和meteor 首先,我添加了包 然后我添加了以下代码: route.js Router.route('/editor', function () { this.render('editor'); }); editor.html <template name="editor"> <form> <textarea name="editor1" id="editor1" rows="10" cols="80"&
Router.route('/editor', function () {
this.render('editor');
});
editor.html
<template name="editor">
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
</form>
</template>
现在,当我浏览到我的/editor路径时,我可以看到最初加载的ckeditor。但是,如果我在页面上按F5,那么我将开始获得纯文本区域,而不使用编辑器替换它。另外,我在javascript控制台中遇到以下错误:
Exception from Tracker afterFlush function:
meteor.js:888
ReferenceError: CKEDITOR is not defined
at Template.editor.rendered (helpers.js:10)
at blaze.js:3338
at Function.Template._withTemplateInstanceFunc (blaze.js:3679)
at fireCallbacks (blaze.js:3334)
at null.<anonymous> (blaze.js:3427)
at blaze.js:1788
at Object.Blaze._withCurrentView (blaze.js:2219)
at blaze.js:1787
at Object.Tracker._runFlush (tracker.js:531)
at onGlobalMessage (meteor.js:373)
追踪器后冲洗功能异常:
meteor.js:888
ReferenceError:未定义CKEDITOR
在Template.editor.rendered(helpers.js:10)
在blaze.js:3338
在Function.Template.\u中使用TemplateInstanceFunc(blaze.js:3679)
在fireCallbacks(blaze.js:3334)
在空。(blaze.js:3427)
在blaze.js:1788
在Object.Blaze.\u和当前视图(Blaze.js:2219)
在blaze.js:1787
在Object.Tracker.\u runFlush(Tracker.js:531)
在onGlobalMessage(meteor.js:373)
您是否尝试过运行
CKEDITOR.replace('editor1')代码>从您的控制台?通常会发生这种错误,因为在加载ckeditor之前调用了它。也许可以尝试从cdn加载ckeditor。是的。从控制台运行此功能可以正常工作。这可能是一个时间问题,就像你提到的。即使从setTimeout在内部运行它,也可以在模板中运行。如果我使用wait-on-lib,并从那里加载ckeditor,那么我是否应该删除lsun:ckeditor包?是的,这就是我过去所做的。
Exception from Tracker afterFlush function:
meteor.js:888
ReferenceError: CKEDITOR is not defined
at Template.editor.rendered (helpers.js:10)
at blaze.js:3338
at Function.Template._withTemplateInstanceFunc (blaze.js:3679)
at fireCallbacks (blaze.js:3334)
at null.<anonymous> (blaze.js:3427)
at blaze.js:1788
at Object.Blaze._withCurrentView (blaze.js:2219)
at blaze.js:1787
at Object.Tracker._runFlush (tracker.js:531)
at onGlobalMessage (meteor.js:373)