富文本编辑器的介绍

一个新手
一个新手原创
2017-09-23 09:45:411211浏览


富文本编辑器

  • 富文本编辑器,Rich TextEditor, 简称 RTE, 它提供类似于 MicrosoftWord 的编辑功能。常 用的富文本编辑器

    KindEditor http://kindeditor.net/

    UEditor http://ueditor.baidu.com/website/

    CKEditor http://ckeditor.com/

引入富文本编辑器

<link rel="stylesheet" href="../plugins/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="../plugins/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script>

初始化 kindeditor 编辑器

<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {

    editor = K.create('textarea[name="content"]', {
    allowFileManager : true

    });
});
</script>

获取在controller.js 中获取文本编辑器内容

$scope.entity.goodsDesc.introduction=editor.html();

清空文本编辑器

function(response){

    if(response.success){
        alert("保存成功");
        $scope.entity={};
        editor.html('');//清空富文本编辑器
        }else{
        alert(response.message);
     }
}

引用编辑器

   <textarea  name="content" style="width:800px;height:400px;visibility:hidden;" ></textarea>

效果图

这里写图片描述

以上就是富文本编辑器的介绍的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。