开发者

ASP CKEditorControl's content length on client-side

I'm using CKEditor in my ASP.NET webforms application. I'm using CKEditor control to put it to my page:

<CKEditor:CKEditorControl ID="CKEditorControl" runat="server开发者_StackOverflow社区" />

But I'd like to get the editor's content length on client-side. I'm trying to do it this way:

CKEDITOR.instances['<%= CKEditorControl.ClientID %>'].getData().length;

Though it's not working because: "Uncaught TypeError: Cannot call method 'getData' of undefined"

So my question is. What am I doing wrong? And is it possible to get the CKEditor's length on client-side when using CKEditorControl?


this code works:

$('#cke_<%= CKEditorControl.ClientID %> iframe').contents().find('body').html()

I'm not sure now but I guess all my problems were because I was trying to get the data before the editor was loaded.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜