开发者

Remove CKEdit Instance

I can't seem to destroy instances of CKEdit per the documentation.

Consider the following:

<input name="txt1" type="text" id="txt1" /><br />
<a href="javascript:void(0);" onclick="create()">Create</a><br />
<a href="javascript:void(0);" onclick="destroy()">Destroy</a>
<script type= "text/javascript" >
<!--
function create() {
    var hEd = CKEDITOR.instances['txt1'];
    if (hEd) {
        CKEDITOR.remove(hEd);
    }
    hEd = CKEDITOR.replace('txt1');
}
function destroy(){
    var hEd = CKEDITOR.instances['txt1'];
    if (hEd) {
        CKEDITOR.remove(开发者_运维问答hEd);
    }
}
-->
</script>

When destroy() runs, CKEDITOR.remove(hEd); is being called. Multiple clicks to create() produce multiple instances of CKEditor on screen, but their instances no longer appear in CKEDITOR.instances.

Am I missing something?


You must use hEd.destroy (editor.destroy()).

CKEDITOR.remove() is for internal use as stated in the API.


Simple solution

CKEDITOR.instances['textareaId'].destory()


You must use:

<textarea name="tx1" id="tx1" rows="15" cols="106"></textarea>

CKEDITOR.instances['tx1'] = false;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜