“执行insertHtml命令时出错";当在“查看源代码"中插入html时,cleditor中会显示一条消息.模式 [英] "Error executing the insertHtml command" message in cleditor when inserting html in "View Source" mode

查看:119
本文介绍了“执行insertHtml命令时出错";当在“查看源代码"中插入html时,cleditor中会显示一条消息.模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到处都在寻找解决方案,但没有找到答案,所以您是我最后的希望,Stackoverflow ...

I've searched for the solution for this everywhere and have not found an answer, so you're my last hope, Stackoverflow...

关于cleditor,有人知道如何使查看源代码"模式下的"inserthtml"命令起作用吗?

With regard to cleditor, does anybody know how to make the "inserthtml" command in "View Source" mode work?

当前,我有一个附加到按钮的onclick处理程序上的方法,该方法将字符串插入cleditor的textarea:

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);

上面的代码在普通的RTF模式下可以正常工作,但是如果您尝试在查看源代码模式下执行它,则会发生以下情况:

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:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆