dongyizhuang0134
2016-08-03 08:16
浏览 41
已采纳

ck_editor不加载实际数据

Why doesn't the ck editor load the last change that I made in source mode? If I have disabled the ck_editor, then the textarea will show all the data. This is my code:

<textarea name="content" id="editor1" rows="10" cols="80">
   <?php print $selecteddata['content']; ?>
</textarea>

<script>
       // Replace the <textarea id="editor1"> with a CKEditor
       // instance, using default configuration.

       CKEDITOR.replace( 'content' ,{
          filebrowserBrowseUrl : './public/browse.php',
          filebrowserUploadUrl : '/uploader/index.php',
          uiColor : '#9AB8F3'
      });

</script>

图片转代码服务由CSDN问答提供 功能建议

为什么ck编辑器没有加载我在源模式下做的最后一次更改? 如果我已禁用了 ck_editor,然后textarea将显示所有数据。 这是我的代码:

 &lt; textarea name =“content”id =“editor1”rows =“10”cols  =“80”&gt; 
&lt;?php print $ selecteddata ['content'];  ?&gt; 
&lt; / textarea&gt; 
 
&lt; script&gt; 
 //替换&lt; textarea id =“editor1”&gt; 使用CKEditor 
 //实例,使用默认配置。
 
 CKEDITOR.replace('content',{
 filebrowserBrowseUrl:'。/ public /browse.php',
 filebrowserUploadUrl:'/ uploader / index。  php',
 uiColor:'#9AB8F3'
}); 
 
&lt; / script&gt; 
   
 
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duangai1916 2016-08-03 15:05
    已采纳

    it was about CKEditor Data Filtering and Features Activation .

    the answer was here. CKEditor automatically strips classes from div

    打赏 评论
  • drgweamoi473182981 2016-08-03 08:40

    Try this:

    <textarea name="content" id="editor1" rows="10" cols="80">
          <?php print $selecteddata['content']; ?>
    </textarea>
    
    <script>
       $(window).load(function(){
          if (typeof(CKEDITOR.instances['content'])=='undefined') {
              CKEDITOR.replace( 'content',{
                filebrowserBrowseUrl : './public/browse.php',
                filebrowserUploadUrl : '/uploader/index.php',
                uiColor : '#9AB8F3'
             });
         }
      });
    </script>
    
    打赏 评论

相关推荐 更多相似问题