Ckeditor_3.6.4 experience

Source: Internet
Author: User

It has recently taken a lot of time to learn how to use ckeditor3.6.4. Now I will write down my experiences and share it with you. I hope you will not take so many detours.

1. Add the downloaded ckeditor folder to your project, as shown in figure

2. Add reference on the page to reference ckeditor: <SCRIPT type = "text/JavaScript" src = "/tools/ckeditor. js"> </SCRIPT>

3. add @ HTML. textarea ("notecontent", null, new {@ class = "ckeditor", id = "test", style = "margin-left: 10px ;"}), now you can see the ckeditor control by running the code.
4. modify ckeditor settings. The initial settings of ckeditor are in config. as set in the JS file, about config. JS settings inside there are a lot of articles introduced, now reference it, this blog is very detailed: http://www.cnblogs.com/xlree/archive/2012/05/21/2511790.html
5. How to retrieve data in ckeditor: editor_data = ckeditor.tools.html encode (ckeditor. Instances. Test. getdata ());

Note: The data must be encoded before it can be passed to the background and stored in the database, because some symbols cannot be identified without encoding.

6. Read the data stored in the database to ckeditor:

@ HTML. textarea ("notecontent", httputility. htmldecode (model. workcontent), new {@ class = "ckeditor", id = "test", style = "margin-left: 10px ;"})
Note: The retrieved data must be decoded because it is encoded when stored.

7. Change the background color of ckeditor in the red box. On the page where ckeditor is located, you can use the following JS statement to change the background color of the red box:

$ ("Iframe" cannot exceed 02.16.content20.doc ument. Body. style. Background = "# DDD ";

However, when the page is loaded for the first time ). ready (function () {// do stuff when Dom is ready}); cannot read $ ("iframe") [0], only after the page loading ends, to read $ ("iframe") [0],

I want to load the background when loading the page. I didn't find a better method, so I used setTimeout ("myload ()", 3000. This method

Method. Once the timeout occurs, it cannot be loaded into the background unless it is refreshed. Is there a better way to load the background in the red box? (Window. onload my program has a conflict, so it cannot be used .)

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.