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 .)