【问题标题】:CKEditor.replace keeps giving errorsCKEditor.replace 不断报错
【发布时间】:2017-04-13 16:36:32
【问题描述】:

系统信息为:PHP Version-5.3.10-1ubuntu3.26;网络服务器: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]。非常难过,错误仍然存​​在。想法?

【问题讨论】:

    标签: ckeditor joomla2.5 php-5.3


    【解决方案1】:

    这段代码可以在html头部区域;或者在这里我把它放在 PHP 脚本编写一系列 case stmts 之前 - 让我看到 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>";
    

    basepath 语句是将它们组合在一起的最后一部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-21
      • 1970-01-01
      • 1970-01-01
      • 2022-08-23
      相关资源
      最近更新 更多