Home  >  Article  >  Web Front-end  >  Introduction to rich text editor

Introduction to rich text editor

一个新手
一个新手Original
2017-09-23 09:45:411745browse


Rich Text Editor

  • Rich Text Editor, Rich TextEditor, referred to as RTE, provides editing functions similar to Microsoft Word. Commonly used rich text editors

    KindEditor http://kindeditor.net/

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

    CKEditor http:/ /ckeditor.com/

Introduce rich text editor

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

Initialize kindeditor editor

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

    editor = K.create(&#39;textarea[name="content"]&#39;, {
    allowFileManager : true

    });
});
</script>

Get the text editor in controller.js Content

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

Clear text editor

function(response){

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

Quote editor

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

Rendering

Introduction to rich text editor

The above is the detailed content of Introduction to rich text editor. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn