系统信息是:PHP Version-5.3.10-1ubuntu3.26; Web服务器:Apache / 2.2.22(Ubuntu); WebServer到PHP接口 - apache2handler;版本Joomla! 2.5.28稳定[Ember] 2014年12月10日15:00 GMT;的Joomla!平台版本 - Joomla Platform 11.4.0稳定。还是,我的:
<script type='text/javascript'>CKEDITOR.replace( 'editor1' );</script>
不断出错:
VM3764:84 GET domain.com/index.php/apps/config.js?t=G87E 404 (Not Found)
VM3764:84 GET domain.com/index.php/apps/skins/moono/editor.css?t=G87E
VM3764:84 GET domain.com/index.php/apps/lang/en.js?t=G87E 404 (Not Found)
CKEDITOR.env.ie.e.$.onerror @ VM3764:232
VM3764:84 GET domain.com/index.php/apps/lang/en.js?t=G87E 404 (Not Found)
CKEDITOR.event.CKEDITOR.event.fire @ VM3764:12
CKEDITOR.editor.CKEDITOR.editor.fire @ VM3764:13
CKEDITOR.env.ie.e.$.onerror @ VM3764:232
VM3764:230 Uncaught TypeError: Cannot set property 'dir' of undefined
所涉及的完整代码就是这样:
echo"<script type='text/javascript' src='https://fabrik.smartstartinc.net/ncpcphp/ckeditor/ckeditor.js'></script>";
echo"<div name='editor1' id='editor1' rows='10' cols='80'>replace this div with CKEditor.</div>";
echo"<script type='text/javascript'>CKEDITOR.replace( 'editor1' );</script>";
使用CKEditors [尝试了多个,相同的结果]:标准[4.0,4.5.11,4.6.2]和完整的4.6.2]。非常难倒,错误仍然存在。想法?
答案 0 :(得分:0)
此代码可以在html头部区域;或者在这里我把它放在PHP脚本之前的一系列案例stmts中 - 让我到达div区域上方的CKEditor:
<script type='text/javascript'> window.CKEDITOR_BASEPATH ='https and domain URL here/ckeditor/';</script>
<script type='text/javascript' src='https and domain URL here/ckeditor/ckeditor.js'></script>
<script type='text/javascript' src='https and domain URL here/ckeditor/config.js'></script>
和用于接受新CKEditor工具栏的现有div代码:
echo "<div id = '$val' class = 'DetailBox' style='display:none; height:415px'></div>";
最后,替换功能:
echo"<script type='text/javascript'>CKEDITOR.replace( '$val');</script>";
basepath语句是最后一个适合它的部分。