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 "inserthtml" command in "View Source" mode work?
Currently, I have a method attached to a button's onclick handler that inserts a string into the cleditor's textarea:
editor.focus();
setTimeout(function() { editor.execCommand('inserthtml', stringToInsert); }, 0);
The above works fine in the normal Rich Text mode but if you try to execute it while in View Source mode, the following will happen:
- In Firefox, it pops up a little message that says "Error executing the inserthtml command."
- In Chrome, it fails silently
- In IE:
- If the textarea was empty, I hit a breakpoint in Visual Studio at "y(a).pasteHTML(c)" in what looks like jquery.cleditor.min.js, with the following message, "Microsoft JScript runtime error: Unspecified error."
- If the textarea already contained text, I hit a breakpoint at "a.range[0].select()" in the same file with the following message, "Microsoft JScript runtime error: Could not complete the operation due to error 800a025e."