Home > Web Front-end > JS Tutorial > body text

Introduction to rich text editor

一个新手
Release: 2017-09-23 09:45:41
Original
1773 people have browsed it


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>
Copy after login

Initialize kindeditor editor

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

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

    });
});
</script>
Copy after login

Get the text editor in controller.js Content

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

Clear text editor

function(response){

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

Quote editor

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template