Skip to content Skip to sidebar Skip to footer

"error Executing The Inserthtml Command" Message In Cleditor When Inserting Html In "view Source" Mode

I've searched for the solution for this everywhere and have not found an answer, so you're my last hope, Stackoverflow... With regard to cleditor, does anybody know how to make the

Solution 1:

hi i think it is very simmilar problem as here

i assume that code pasted by you is executed in button click function at the end of this function just add

return false;

add sopmething like that:

function someClick(e, data) {

// Get the editorvar editor = data.editor;

   editor.focus();
   setTimeout(function() { editor.execCommand('inserthtml', stringToInsert); }, 0);

   returnfalse;

}

edit:

yep you are right it is not so easy : when yo are in normal mode your text area is actualy iframe when you are in source mode your textarea is again becomeing textarea so to edit data inside you can get it by

$('#mytextarea').val()

if you want to append something at the end you can use :

setTimeout(function() {$('#mytextarea').val($('#mytextarea').val()+'aaaaa') }, 3000);    

if you want to insert at current ursor cosition this should help : Cursor position in a textarea (character index, not x/y coordinates)

Post a Comment for ""error Executing The Inserthtml Command" Message In Cleditor When Inserting Html In "view Source" Mode"