zoukankan      html  css  js  c++  java
  • EasyUI集成Kindeditor使用

    在实际的项目中,我们需要在项目中集成富文本编辑器,而kindeditor作为一款优良的编辑器,在项目中或多或少都会用到!

    实际效果图
     
     

    使用方法:

    1.首先下载Kindeditor编辑器,我这里使用的是4.1.10版本。下载地址:http://kindeditor.net/down.php

    2.在所需页面上引入Kindeditor相关js文件(注意引入路径):

    <!--引入引入kindeditor编辑器相关文件-->
    <link rel="stylesheet" href="Kindeditor4.1.10/themes/default/default.css" />
    <script charset="utf-8" src="Kindeditor4.1.10/kindeditor.js"></script>
    <script charset="utf-8" src="Kindeditor4.1.10/lang/zh_CN.js"></script>

    3.在所需页面上需要一个<textarea></textarea>,(注意ID号唯一)如下所示:

     <textarea id="content" name="content"  style="700px; height:300px;"></textarea>

    4.在页面创建Kindeditor(参数自己可以根据实际项目选配):

    <script type="text/javascript">
     $(function(){
        var editor;
        window.editor = KindEditor.create('#content',{
                  resizeType:1,      
                  urlType:'domain', // 带有域名的绝对路径
     });
     });
    </script>

    不能使用以下方式,使用以下方式会导致在谷歌、火狐等浏览器下无法正常显示编辑器。因为KindEditor.ready无法正常执行。

    <script>
     var editor;
     KindEditor.ready(function(K){
        window.editor = K.create('#content',{

             resizeType:1, 
             urlType:'domain', // 带有域名的绝对路径
        });
    });
    </script>

  • 相关阅读:
    php 观察者模式
    php 策略模式
    php 适配器模式
    php 单例模式
    程序员应该关注的行业网站
    Mysql 5.7 索引使用规则和设计优化
    Docker官方镜像源或阿里云镜像源加速解决pull过慢的问题
    MySQL 优化案例
    mysql优化count(*)查询语句
    Mysql超大分页优化处理
  • 原文地址:https://www.cnblogs.com/dogdogwang/p/6927473.html
Copyright © 2011-2022 走看看