Opened 12 years ago
Closed 12 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 12 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
| 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