Which character do I need to replace to safely ‘print’ raw HTML code from a database in a textarea, so I can edit this with CKeditor?
Or is there another existing preferred method of getting data into a CKeditor textarea? (e.g. AJAX)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CKEditor will use the initial contents of the textarea, so all you need to do is escape it as you normally would, e.g.:
See also CKEDITOR.replace.
If you want to set the contents of the textarea after CKEditor is loaded, use the setData API function:
In both cases, CKEditor will load the raw HTML and do whatever preprocessing is necessary to make it work.