我有一个具有以下CKEditor的ASP.net用户控件
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<CKEditor:CKEditorControl ID="txtHtmlText" BasePath="~/Scripts/ckeditor/"
Toolbar="Bold|Italic|Underline|Strike|Subscript|Superscript|- |TextColor|BGColor|Font|FontSize
JustifyLeft|JustifyCenter|JustifyRight|Justify|-|Outdent|Indent|- |NumberedList|BulletedList
Cut|Copy|Paste|PasteText|PasteFromWord|-|HorizontalRule|Link|Unlink|- |Source|About"runat="server"></CKEditor:CKEditorControl>我正在尝试覆盖CKEditor的config.js中定义的字数限制。我在.ascx文件中使用了以下代码,并得到了错误
“未捕获ReferenceError:未定义检查器”。请帮帮忙
<script type="text/javascript">
CKEDITOR.replace('txtHtmlText',
{
wordcount: {
// Whether or not you want to show the Paragraphs Count
showParagraphs: false,
// Whether or not you want to show the Word Count
showWordCount: false,
// Whether or not you want to show the Char Count
showCharCount: true,
// Whether or not you want to count Spaces as Chars
countSpacesAsChars: false,
// Whether or not to include Html chars in the Char Count
countHTML: false,
// Maximum allowed Word Count, -1 is default for unlimited
maxWordCount: 500,
// Maximum allowed Char Count, -1 is default for unlimited
maxCharCount: 500
}
});
</script>发布于 2015-06-25 20:52:52
我今天尝试了我的需求,我能够成功地添加功能。
如果我处在你的位置,我会检查几件事
这个链接帮助我解决了我的问题@ https://github.com/w8tcha/CKEditor-WordCount-Plugin/blob/master/wordcount/samples/wordcountWithMaxCount.html
发布于 2015-06-25 21:02:14
@Vinayak Prabha,
按照Vikram的建议进行尝试。然而,这是一个问题?
客户端Id "txtHtmlText“是服务器id,如果必须在java脚本中使用,则应使用CKEditor ID。
试着这样做
var ckEditorClientID = "#<%=txtHtmlText.ClientID %>";
CKEDITOR.replace(ckEditorClientID、
https://stackoverflow.com/questions/30790907
复制相似问题