I'm having problem getting the textarea(ckeditor) value. This is the script line :
<script src="https://cdn.ckeditor.com/ckeditor5/11.1.1/classic/ckeditor.js"></script>
This is my textarea code :
@Html.TextAreaFor(model => model.FullNews, new { @class = "form-control", @id = "Parag" })
This is my scripts section code :
ClassicEditor
.create(document.querySelector('#Parag'))
.catch(error => {
console.error(error);
});
function loadData() {
debugger;
var head = $("#Header").val();
var para = CKEDITOR.instances.Parag.getData();
document.getElementById("Para").innerHTML = para;
document.getElementById("Head").innerHTML = head;
readURL(document.getElementById("newsImage"));
$("#previwe_before_publish").modal("show");
}
When i debug it in browser, i get the error "Uncaught ReferenceError: CKEDITOR is not defined" in the line :
var para = CKEDITOR.instances.Parag.getData();
I searched over the internet but couldn't find the solution for it. Can anybody help me ?