I'm having problem getting data from ckeditor textarea [duplicate]












0
















This question already has an answer here:




  • CKEditor 5 – get editor instances

    1 answer




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 ?










share|improve this question













marked as duplicate by Community Nov 20 '18 at 5:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • @StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

    – Shiwa
    Nov 20 '18 at 5:07











  • @charlietfl I did. same error.

    – Shiwa
    Nov 20 '18 at 5:08
















0
















This question already has an answer here:




  • CKEditor 5 – get editor instances

    1 answer




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 ?










share|improve this question













marked as duplicate by Community Nov 20 '18 at 5:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • @StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

    – Shiwa
    Nov 20 '18 at 5:07











  • @charlietfl I did. same error.

    – Shiwa
    Nov 20 '18 at 5:08














0












0








0









This question already has an answer here:




  • CKEditor 5 – get editor instances

    1 answer




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 ?










share|improve this question















This question already has an answer here:




  • CKEditor 5 – get editor instances

    1 answer




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 ?





This question already has an answer here:




  • CKEditor 5 – get editor instances

    1 answer








javascript c# jquery asp.net-mvc ckeditor






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 4:57









ShiwaShiwa

248




248




marked as duplicate by Community Nov 20 '18 at 5:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Community Nov 20 '18 at 5:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • @StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

    – Shiwa
    Nov 20 '18 at 5:07











  • @charlietfl I did. same error.

    – Shiwa
    Nov 20 '18 at 5:08



















  • @StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

    – Shiwa
    Nov 20 '18 at 5:07











  • @charlietfl I did. same error.

    – Shiwa
    Nov 20 '18 at 5:08

















@StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

– Shiwa
Nov 20 '18 at 5:07





@StephenMuecke I haven't defined that. I have only used the cdn link that I have mentioned above. Nothing more than the code above. Can you suggest me what more should I do ?

– Shiwa
Nov 20 '18 at 5:07













@charlietfl I did. same error.

– Shiwa
Nov 20 '18 at 5:08





@charlietfl I did. same error.

– Shiwa
Nov 20 '18 at 5:08












1 Answer
1






active

oldest

votes


















0














CKEDITOR.instances simply is not defined in CKEditor 5. According to this section of the CKEditor 5 FAQ:




What happened to the global window.CKEDITOR? How to list all instances of the editor?



By default, CKEditor 5 has no global registry of editor instances. But if necessary, such feature can be easily implemented as explained in the Stack Overflow answer.




However, it is defined in CKEditor 4. Refer to the StackOverflow answer referenced in the CKEditor 5 documentation, or shift to CKEditor 4 for your code to function.






share|improve this answer
























  • Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

    – Shiwa
    Nov 20 '18 at 5:31











  • @Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

    – Max K
    Nov 20 '18 at 5:33











  • Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

    – Shiwa
    Nov 20 '18 at 5:35











  • @Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

    – Max K
    Nov 20 '18 at 5:37











  • If you flagged as a duplicate you should NOT have added an answer!

    – user3559349
    Nov 20 '18 at 5:38


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














CKEDITOR.instances simply is not defined in CKEditor 5. According to this section of the CKEditor 5 FAQ:




What happened to the global window.CKEDITOR? How to list all instances of the editor?



By default, CKEditor 5 has no global registry of editor instances. But if necessary, such feature can be easily implemented as explained in the Stack Overflow answer.




However, it is defined in CKEditor 4. Refer to the StackOverflow answer referenced in the CKEditor 5 documentation, or shift to CKEditor 4 for your code to function.






share|improve this answer
























  • Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

    – Shiwa
    Nov 20 '18 at 5:31











  • @Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

    – Max K
    Nov 20 '18 at 5:33











  • Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

    – Shiwa
    Nov 20 '18 at 5:35











  • @Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

    – Max K
    Nov 20 '18 at 5:37











  • If you flagged as a duplicate you should NOT have added an answer!

    – user3559349
    Nov 20 '18 at 5:38
















0














CKEDITOR.instances simply is not defined in CKEditor 5. According to this section of the CKEditor 5 FAQ:




What happened to the global window.CKEDITOR? How to list all instances of the editor?



By default, CKEditor 5 has no global registry of editor instances. But if necessary, such feature can be easily implemented as explained in the Stack Overflow answer.




However, it is defined in CKEditor 4. Refer to the StackOverflow answer referenced in the CKEditor 5 documentation, or shift to CKEditor 4 for your code to function.






share|improve this answer
























  • Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

    – Shiwa
    Nov 20 '18 at 5:31











  • @Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

    – Max K
    Nov 20 '18 at 5:33











  • Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

    – Shiwa
    Nov 20 '18 at 5:35











  • @Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

    – Max K
    Nov 20 '18 at 5:37











  • If you flagged as a duplicate you should NOT have added an answer!

    – user3559349
    Nov 20 '18 at 5:38














0












0








0







CKEDITOR.instances simply is not defined in CKEditor 5. According to this section of the CKEditor 5 FAQ:




What happened to the global window.CKEDITOR? How to list all instances of the editor?



By default, CKEditor 5 has no global registry of editor instances. But if necessary, such feature can be easily implemented as explained in the Stack Overflow answer.




However, it is defined in CKEditor 4. Refer to the StackOverflow answer referenced in the CKEditor 5 documentation, or shift to CKEditor 4 for your code to function.






share|improve this answer













CKEDITOR.instances simply is not defined in CKEditor 5. According to this section of the CKEditor 5 FAQ:




What happened to the global window.CKEDITOR? How to list all instances of the editor?



By default, CKEditor 5 has no global registry of editor instances. But if necessary, such feature can be easily implemented as explained in the Stack Overflow answer.




However, it is defined in CKEditor 4. Refer to the StackOverflow answer referenced in the CKEditor 5 documentation, or shift to CKEditor 4 for your code to function.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 5:10









Max KMax K

346115




346115













  • Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

    – Shiwa
    Nov 20 '18 at 5:31











  • @Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

    – Max K
    Nov 20 '18 at 5:33











  • Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

    – Shiwa
    Nov 20 '18 at 5:35











  • @Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

    – Max K
    Nov 20 '18 at 5:37











  • If you flagged as a duplicate you should NOT have added an answer!

    – user3559349
    Nov 20 '18 at 5:38



















  • Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

    – Shiwa
    Nov 20 '18 at 5:31











  • @Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

    – Max K
    Nov 20 '18 at 5:33











  • Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

    – Shiwa
    Nov 20 '18 at 5:35











  • @Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

    – Max K
    Nov 20 '18 at 5:37











  • If you flagged as a duplicate you should NOT have added an answer!

    – user3559349
    Nov 20 '18 at 5:38

















Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

– Shiwa
Nov 20 '18 at 5:31





Thanks ! It worked. Since I found out now that the question has already been asked before, should I delete this question ? I mean what's the general convention in stackoverflow ?

– Shiwa
Nov 20 '18 at 5:31













@Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

– Max K
Nov 20 '18 at 5:33





@Shiwa mark this answer has correct, upvote it if it is clear and logical / helped you easily, and then someone can mark it as a duplicate.

– Max K
Nov 20 '18 at 5:33













Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

– Shiwa
Nov 20 '18 at 5:35





Okay. I marked it as correct. But I couldn't upvote it due to my low reputation. Are you sure I'm not supposed to delete this question ?

– Shiwa
Nov 20 '18 at 5:35













@Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

– Max K
Nov 20 '18 at 5:37





@Shiwa StackOverflow has a duplicate flagging system so that if a question like this is asked by someone else and they end up here instead, they can be routed to the duplicate. I have flagged the question and a moderator will eventually come through and accept the question as duplicate.

– Max K
Nov 20 '18 at 5:37













If you flagged as a duplicate you should NOT have added an answer!

– user3559349
Nov 20 '18 at 5:38





If you flagged as a duplicate you should NOT have added an answer!

– user3559349
Nov 20 '18 at 5:38



Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$