ReferenceError:未定义CKEDITOR [英] ReferenceError: CKEDITOR is not defined

查看:193
本文介绍了ReferenceError:未定义CKEDITOR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 CKeditor ,但是当我尝试示例,浏览器中仅显示一个texbox。


ReferenceError:未定义CKEDITOR [此错误中断]

CKEDITOR.replace('editor1');
/ xampp /(第13行)


请注意,该示例在我的网站托管。可以从浏览器访问文件ckeditor.js。

解决方案

/ ckeditor /中删除斜杠ckeditor.js (因此请尝试使用 ckeditor / ckeditor.js )。



前斜杠表示 root



因此,如果您使用的是 http://bp.php5.cz/ 这样的URL,然后说 /ckeditor/ckeditor.js ,这表示 http://bp.php5.cz/ckeditor/ckeditor.js 。但是,如果您的URL是 localhost / xampp / ,它将解析为 localhost / ckeditor / ckeditor.js ,即



如果省略前导斜线,则相对URL将由当前URL解析,因此在两种情况下都是正确的。 / p>

最安全的方法当然是使用绝对URL。


I am trying to use the CKeditor but the following error shows up (in JS console) when I try the sample from the tutorial and only a texbox shows in the browser.

ReferenceError: CKEDITOR is not defined [Break On This Error]
CKEDITOR.replace( 'editor1' ); /xampp/ (line 13)

Note that the sample works when I try it on my webhosting. The file ckeditor.js is accessible from the browser.

解决方案

Remove the leading slash from /ckeditor/ckeditor.js (so try with ckeditor/ckeditor.js).

The leading slash means the "root".

So if you are using an URL like http://bp.php5.cz/, and then say /ckeditor/ckeditor.js, it will mean http://bp.php5.cz/ckeditor/ckeditor.js. But if your URL is localhost/xampp/, it will resolve to localhost/ckeditor/ckeditor.js, which is not what you want.

If you omit the leading slash, the relative URL will be resolved from the "current URL", so it will be correct in both cases.

The safest way would be of course to use the absolute URL.

这篇关于ReferenceError:未定义CKEDITOR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆