使用富文本编辑器Kindeditor

  今天在做需求的时候,遇到有一个字段,需要保存带有格式的内容,决定使用富文本框编辑器Kindeditor来实现,解决方法如下:

  登录官网下载控件包: http://kindeditor.net/down.php

  下载后解压,把解压到的文件夹整个复制到项目里面,

  然后,在需要用这个控件的页面这样引用它:<script src="../../kindeditor/kindeditor-all.js" type="text/javascript" />

  然后在页面<body></body>后面加上这一段

  <script type="text/javascript">

    KindEditor.ready(function(K){

      var editor1=K.create('#txtRules',{

        afterChange:function(){

          var self=this;

          self.sync();

        }

      });

    });

</script>

  

猜你喜欢

转载自www.cnblogs.com/luoocean/p/8601832.html