我的 Greasemonkey 脚本没有定义 CKEDITOR?
我正在使用 Greasemonkey 将 KTML 编辑器替换为 CKEditor。
我首先摆脱 KTML,然后加载 jQuery,然后加载 ckeditor.js,这显然是有效的。
但是,当我去替换
我可以在页面加载后通过在 Firebug 控制台中输入 CKEDITOR.replace('editor1');
来替换它。那么 CKEditor 一定是由 Greasemonkey 加载的。?。
I'm using Greasemonkey to replace a KTML editor with CKEditor.
I first get rid of KTML, then I load jQuery and then ckeditor.js and that works, apparently.
But, when I go to replace the <textarea>
, Firebug reports "CKEDITOR is not defined"
and my textarea stays normal. Am I loading them in the wrong order?
I can replace it -- after the page loads -- by entering CKEDITOR.replace('editor1');
in the Firebug console. So CKEditor must have been loaded by Greasemonkey.?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您的问题可能是在您尝试
.replace
时浏览器未完成加载(因此未解析)CKEditor js 文件。Your problem might be that the browser didn't finish loading (and thus didn't parse) the CKEditor js file at the time you're trying the
.replace
.您是否正在加载文本区域和执行“替换”的脚本
通过阿贾克斯?
试试这个:
或者
Are you loading the textarea and the script that executes the 'replace'
via ajax?
Try this:
or
我在使用 CodeIgniter 构建的网站中拥有此内容。 “CKEDITOR未定义”只是意味着它找不到js文件。就我而言,我刚刚编辑了 .htaccess url 重写,这破坏了路径。
因此,如果您在 16 个月内没有修复此问题,请检查您的文件路径。
I had this in a site I'd built using CodeIgniter. The "CKEDITOR is not defined" just means that it can't find the js file. In my case I'd just edited the .htaccess url rewrite, which broke the path.
So, if you've not fixed this in the intervening 16 months, check your file paths.
试试这个,而不是
我的默认设置
Instead of
which was the default on mine, try this
尝试从 ckeditor 文件夹中删除
.htaccess
。如果您的服务器是 IIS,也许这就是问题。对我来说,它有效!
Try deleting
.htaccess
from ckeditor folder. Maybe, if your server is IIS this is problem.For me, it worked!