未捕获[CKEDITOR.editor]实例"html"已存在

Vla*_*lad 2 ckeditor

我在加载CKEDITOR时遇到问题.我已经完成了这里描述的所有内容:http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Integration但是无论如何我得到一个错误(谷歌Chrome 4.x)未捕获[CKEDITOR.editor]实例"html " 已经存在.这是我的代码:

<script type="text/javascript" src="/engine/jq.js"></script> 
<script type="text/javascript" src="/engine/cke/ckeditor.js"></script> 
<script type="text/javascript" src="/engine/cke/adapters/jquery.js"></script>

<textarea class="jquery_ckeditor" name="html" id="html" rows="10">text</textarea>
<script type="text/javascript">
    if (CKEDITOR.instances['html']) { CKEDITOR.remove(CKEDITOR.instances['html']); // with or without this line of code - rise an error }
    CKEDITOR.replace('html');
</script>
Run Code Online (Sandbox Code Playgroud)

小智 7

检查一下:

if (CKEDITOR.instances['html']) { 
    delete CKEDITOR.instances['html'] 
};

CKEDITOR.replace('html');
Run Code Online (Sandbox Code Playgroud)