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" />
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:
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.