CKEDITOR.instance becomes undefined when move to plain text editor and then again to rich text editor

I have written some jquery on Ckeditor.instances. For example my ckeditor instance is edit-body-und-0-value.

When I run the following code.

CKEDITOR.instances[edit-body-und-0-value].on('change', function() { alert('a'); }); 

But when I click on switch to plain text editor and then write something and then click on switch to rich text editor, I got the following error.

CKEDITOR.instances[edit-body-und-0-value] is undefined. 

Can anyone tell me how will I handle this? And why CKEDITOR.instances[edit-body-und-0-value] becomes undefined when clicking the toggel link of switching the editor?

Replay

Category: 7 Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.210 (s). 12 q(s)