Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
113
rated 0 times [  120] [ 7]  / answers: 1 / hits: 66523  / 15 Years ago, sun, march 14, 2010, 12:00:00

I'm using CKEditor in my web app, and I'm at a loss as to how to get the contents of the editor with HTML formatting.



var objEditor = CKEDITOR.instances[sectionTextArea];
var q = objEditor.getData();


This will get me the text entered in CKEditor, without any markup.



However,



var q = objEditor.getHTML();


will return a null value. What am I doing wrong?


More From » html

 Answers
5

getHTML isn't a method of a CKEditor object, so instead of null you should have a javascript error.



The method defined by the api is getData() if that doesn't work then you have some other problem in your code, try to use an alert to verify the contents at that moment.


[#97348] Wednesday, March 10, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
devinjadong questions
Thu, Feb 17, 22, 00:00, 2 Years ago
Wed, Dec 8, 21, 00:00, 2 Years ago
Tue, Oct 27, 20, 00:00, 4 Years ago
Fri, Oct 18, 19, 00:00, 5 Years ago
;