0

我有一个看起来像这样的代码:

<div class="menuslct">
  <table width="980" border="0" style="text-align:center">
    <tbody><tr>
      <td width="33%"><a href="/en/education"><img src="/common/img/icons/01 online.PNG" name="online" width="81" height="78"></a></td>
      <td width="33%"><a href="http://esukhia.org/en/education/immersion"><img src="/common/img/icons/02 immersion.jpg" name="immersion" width="80" height="78"></a></td>
      <td width="33%"><a href="http://esukhia.org/en/education/thesisadv"><img src="/common/img/icons/03 Thesis Advisor.jpg" width="78" name="thesisadv" height="78"></a></td>
    </tr>
    <tr>
      <td width="33%" name="online">Online</td>
      <td width="33%" name="immersion">Immersion</td>
      <td width="33%" name="thesisadv">Research Advisor</td>
    </tr>
  </tbody></table>
</div>

但是当通过 php 在 ckeditor 中打开时,包括:

<textarea name="editor1" id="editor1">
      <?php echo file_get_contents('education.php');?>
    </textarea>
        <script>
            CKEDITOR.replace( 'editor1' );
        </script>

它看起来像这样:

<div class="menuslct">
<table border="0" style="text-align:center; width:980px">
<tbody>
    <tr>
        <td><a href="/en/education"><img src="/common/img/icons/01 onlie.PNG" style="height:78px; width:81px" /></a></td>
        <td><a href="http://esukhia.org/en/education/immersion"><img src="/common/img/icons/02 immersion.jpg" style="height:78px; width:80px" /></a></td>
        <td><a href="http://esukhia.org/en/education/thesisadv"><img src="/common/img/icons/03 Thesis Advisor.jpg" style="height:78px; width:78px" /></a></td>
    </tr>
    <tr>
        <td>Online</td>
        <td>Immersion</td>
        <td>Research Advisor</td>
    </tr>
</tbody>
</table>
</div>

为什么ckeditor会那样剥离我的代码?

4

1 回答 1

0

我通过这种方式调用这个ckeditor让它工作:

CKEDITOR.replace( 'editor1',{allowedContent: true} );

这将删除所有 ckeditor 剥离功能。

于 2013-11-13T13:52:46.867 回答