I am calling a same jsp page twice using a Ajax call. But getting the following error and it is displaying the textarea and not the CKEditor:
TypeError: a is undefined
TypeError: a.ui.space(...) is null
My Code is:
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
$( document ).ready(function() {
if (CKEDITOR.instances['questionText']) {
CKEDITOR.remove(CKEDITOR.instances['questionText']);
}CKEDITOR.replace('questionText', {
enterMode : CKEDITOR.ENTER_BR,
shiftEnterMode: CKEDITOR.ENTER_BR,
coreStyles_bold: { element: 'b' },
coreStyles_italic: { element: 'i' }
});
});
if (CKEDITOR.instances['questionText']) {
CKEDITOR.instances['questionText'].on('change',function() {
$('#questionText').val(CKEDITOR.instances['questionText'].getData());});
}</script>
Please help me. I am struggling on it since 5 days. :(