CKEDITOR не определяется при очистке текстовой области jquery [дубликат]Jquery

Программирование на jquery
Гость
CKEDITOR не определяется при очистке текстовой области jquery [дубликат]

Сообщение Гость »


У меня есть текстовая область, инициализированная в форме. После отправки данных в форму я хочу очистить текстовую область, в которой есть плагин ck editor. Моя проблема в том, что когда я пытаюсь очистить ее с помощью этого кода, я получаю сообщение об ошибке в журнале консоли

Код: Выделить всё

Uncaught ReferenceError: CKEDITOR is not defined
here is my ajax code where am trying to empty the data in the textarea.

Код: Выделить всё

    $.ajax({
url: 'create-book',
method: 'POST',
processData: false,
contentType: false,
data: formdata,
success: function(response) {
CKEDITOR.instances['bookDesc'].setData('')
}
});
already i have intitalized the editor this way when loading the page

Код: Выделить всё

    $(document).ready(function() {
let theEditor;
ClassicEditor.create( document.querySelector( '#bookDesc' ),
{
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote','|',
'undo', 'redo',]
})
.then(editor => {
theEditor = editor;
})

.catch( error => {
console.error( error );
});
});
in the layout file i have placed the links this way i have tried a couple of solutions but none is working.which part might i be missing the point here


Источник: https://stackoverflow.com/questions/781 ... rea-jquery

Вернуться в «Jquery»