CKEditor is duplicating a field -


so original problem needed rid of img style attribute on images in ckeditor.

i found code trick:

if (ckeditor.instances['field_id_4']) {     ckeditor.remove(ckeditor.instances['field_id_4']); }         ckeditor.replace('field_id_4',{     allowedcontent:          'img[!src,alt,width,height]{float};' +          'h1 h2 div'     }); 

but when top condition there.

now see though, ckeditor duplicated...

anyone know how fix this?

you should use editor.destroy() instead of ckeditor.remove private method.

something like:

if (ckeditor.instances['field_id_4']) {     ckeditor.instances['field_id_4'].destroy(); }         ckeditor.replace('field_id_4',{     allowedcontent:          'img[!src,alt,width,height]{float};' +          'h1 h2 div' }); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -