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
归档时间: |
|
查看次数: |
12392 次 |
最近记录: |