(原)jquery + KindEditor 文本编辑器

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31653405/article/details/83009137

先看效果:

 1、首先页面编写html textarea 引入插件文件

<textarea id="editor_id" name="content"style="width:700px;height:500px;visibility:hidden;">

</textarea>
<!-- 添加文本编辑器插件 -->
    <script charset="utf-8" type="text/javascript"  src="/kindeditor/kindeditor-all.js"></script>
	<script charset="utf-8" type="text/javascript"  src="/kindeditor/lang/zh-CN.js"></script>

2、创建编辑器格式区域

         KindEditor.ready(function(K) {
		    	editor1 = K.create('textarea[name="content"]', {
					cssPath : '../plugins/code/prettify.css'
				});
				prettyPrint();
		});

3、执行程序时,进行取值

var productIntroduce = document.getElementById('editor_id').value; //获取编辑器

4、程序回显时,进行赋值

var productIntroduce = data.productIntroduce;
KindEditor.html("#editor_id", productIntroduce);

5、以上就是程序所有代码部分


以上是自己整理的,并测试过,可以直接用

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

文章中,有问题,可以在评论区评论,一起探讨编程中奥秘!

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

来都来了,代码看都看了,那就留个言呗,可以互动下!

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

转载声明:本文为博主原创文章,未经博主允许不得转载

猜你喜欢

转载自blog.csdn.net/qq_31653405/article/details/83009137