About CKEditor Second load problem

Source: Internet
Author: User

In the use of ckeditor appear more problems, one problem is the picture upload problem, one is the second load when the CKEditor edit box can not be a problem

The first problem is that there is a second problem with modifying the CKEditor JS property on the Internet, but it's not very useful here.

First of all my ID is using the dynamic ID [email protected]

<textarea class= "CKEditor" id= "[email protected]" cols= "rows=" 2 "style=" height:100px "> @FieldValue </ Textarea>
<input type= "hidden" name= "@Model. FieldName" value= "@FieldValue"/>

So to get the id var ckname = $ (". CKEditor"). attr ("id");

-------------------------------------------------------------

The next step is to deal with

<script src= "/scripts/ckeditor/ckeditor.js" ></script>
<textarea class= "CKEditor" id= "[email protected]" cols= "rows=" 2 "style=" height:100px "> @FieldValue </ Textarea>
<input type= "hidden" name= "@Model. FieldName" value= "@FieldValue"/>
Resolve CKEditor The second load does not appear to be the problem
<script type= "Text/javascript" >
var ckname = $ (". CKEditor"). attr ("id");
if (ckeditor.instances["" + Ckname + ""])
{
Ckeditor.remove (ckeditor.instances["" + Ckname + ""]);
}
var editor = Ckeditor.replace ("" + Ckname + "");
</script>

That's it, okay?

CKEditor Get value: var Ckcode = (Ckeditor.instances[ckname].getdata ());

About CKEditor Second load problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.