Opened 10 years ago

Closed 10 years ago

#11138 closed Bug (invalid)

insertHtml not inserting images in CKEditor content.

Reported by: Ameya Sohoni Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I am using the following code in order to insert the image, but image is not getting inserted in content.

insertHtml = function( objectId, stContent, position ) {

var editor = CKEDITOR.instances[objectId]; if( editor.mode = 'wysiwyg' ) {

editor.insertHtml( strContent ); CKEDITOR.instances[objectId].updateElement(); var instance = CKEDITOR.instances[objectId]; CKEDITOR.replace( objectId );

} else {

alert( 'You must be in WYSIWYG mode.' );

}

}

but after doing this it is giving me this error. Uncaught the editor instance "XYZ for example" is already attached to the provided element.

Change History (1)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Resolution: invalid
Status: newclosed
Version: 4.2.2

Your code is invalid. I don't understand why you initialize editor after using it. You can ask your question on http://ckeditor.com/forums

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy