2017-04-13 74 views
0

系统信息是:PHP Version-5.3.10-1ubuntu3.26; Web服务器:Apache/2.2.22(Ubuntu); WebServer到PHP接口 - apache2handler;版本Joomla! 2.5.28稳定[Ember] 10-December-2014 15:00 GMT;的Joomla!平台版本 - Joomla Platform 11.4.0稳定。尽管如此,我:CKEditor.replace不断给出错误

<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

这段代码可以在html头部区域;还是在这里,我把它仅仅是PHP脚本一系列的案例撑条的前 - 让我到了CKEditor的出现在div区域上方:

<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>"; 

的基本路径说明,那就是适合其结合在一起的最后一块。