我有一个ckeditor对象,我想插入文本当前位置。所以我尝试获取ckeditor对象,但是页面返回错误。我的ckeditor版本是3.6.4
ASPX:
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<CKEditor:CKEditorControl Width="100%" BasePath="~/Controls/Base/ckeditor" CssClass="AutoCompColumnList" ID="txtMessageBody" Height="500px" runat="server"
</CKEditor:CKEditorControl>
</ContentTemplate>
</asp:UpdatePanel>我试过这个:
此处的CKEDITOR.instances.txtMessageBody.insertText('some文本‘);
错误:
没有定义CKEDITOR!
发布于 2014-08-07 16:38:28
我最近尝试使用CKEditor,但后来放弃了,因为它似乎需要很长时间才能打开页面,而且它一直在html旁边添加回车符。为了摆脱这一点,我不得不写下以下内容:
var editor;
function changeEnter()
{
if (editor)
editor.destroy(true);
editor = CKEDITOR.replace('CKEditor1',
{
on:
{
instanceReady: function (ev)
{
//output paragraphs as <p>Text</p>
this.dataProcessor.write.setRules('p',
{
indent: false,
breakBeforeOpen: true
});
}
}
});
window.onload = changeEnter;我从他们的一个示例页面中获取了所有这些内容。我真的不知道它是做什么的,但它是有效的。在把它放到页面上之前,我一直收到CKEditor没有定义的消息。
抱歉,我不想费心缩进代码。为什么在这个网站上发布代码这么难。它将自己定位为卓越的软件论坛--然而你编写代码的方式太糟糕了。为什么没有像你在其他网站上得到的代码标签?
https://stackoverflow.com/questions/25177205
复制相似问题