ckeditor引入笔记

1.首先下载ckeditor_3.3.2.zip

2.解压后部署到项目目录下面  查看simple ckeditor/_samples/replacebyclass.html 案例

<textarea class="ckeditor" cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>

引入ckeditor 这个文件

<script type="text/javascript" src="../ckeditor.js"></script>

3.一般选用方式

<script type="text/javascript" src="../ckeditor.js"></script>

<textarea cols="80" id="editor2" name="editor2" rows="10">
<script type="text/javascript">
//<![CDATA[

// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.

// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
CKEDITOR.replace( 'editor2' );

//]]>
</script>

根据ID来replace

4.注意

<script type="text/javascript">
function initEditor(){
CKEDITOR.replace( 'content',
{
skin : 'office2003',
width:700
}
);
}
</script>
</head>
<body onload="initEditor()">

5.相关内容查看官网 https://ckeditor.com/

posted @ 2018-01-02 15:00  老鱼SOHO  阅读(385)  评论(0)    收藏  举报