未捕获的异常:[CKEDITOR.editor]该实例已存在

hor*_*gen 11 javascript ckeditor

我在我的网站上包含了CKEditor.即使我收到这个JS错误,一切正常:

未捕获的异常:[CKEDITOR.editor]实例"simple_editor"已经存在.

下面的代码包含在PHP文件中,我在其中包含了我想要编辑器的位置.我每页只有一个编辑器实例.

<textarea class='ckeditor' id='simple_editor' name='simple_editor'>".$page_content."</textarea>";

<script type="text/javascript">
 CKEDITOR.replace( 'simple_editor',
 { 
  height: '110px',
  toolbar :
  [
   ['Link','Unlink'],
   ['Styles','Format','Font','FontSize'],
   ['Bold','Italic','Underline','Strike'],
   ['TextColor','BGColor'],
   ['NumberedList','BulletedList','Outdent','Indent']
  ]
 }); 
</script>
Run Code Online (Sandbox Code Playgroud)

经过一些谷歌搜索后,我看到人们发布了一些有效的解决方案.

if (CKEDITOR.instances['simple_editor']) { delete CKEDITOR.instances['simple_editor'] };
if (CKEDITOR.instances['simple_editor']) { CKEDITOR.instances['simple_editor'].destroy(); }
Run Code Online (Sandbox Code Playgroud)

谁知道该怎么办?:S

Alf*_*oML 17

删除class ='ckeditor',因为它触发了自动替换系统.