Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError: CKEDITOR is not defined

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.

like image 696
Slazer Avatar asked May 07 '13 11:05

Slazer


1 Answers

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.

like image 131
kapa Avatar answered Nov 14 '22 21:11

kapa