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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With