Ckeditor ajax отправка формы
Имеется следующая функция:
function Preview(type) {
if (type == '/profile/articles') {
for (instance in ClassicEditor.instances) {
ClassicEditor.instances[instance].updateElement();
}
}
var data = $('#form').serializeArray();
$.ajax({
type: 'POST',
data: data,
url: type + '/preview',
dataType: 'json',
success: function (data) {
if (data.error.length > 0) {
new Noty({
type: 'error',
layout: 'topRight',
theme: 'relax',
text: data['error'],
timeout: 2000,
}).show();
} else {
window.open(data.url, '_blank');
}
}
});
}
Все бы ничего, но текст получить не могу. Как можно исправить?