zoukankan      html  css  js  c++  java
  • Fckeditor使用手册

    1. 新建一个编辑器
    Head:
    <script type="text/javascript" src="editor_path/fckeditor.js"></script>

    Html:
    <textarea id="content" name="content" style=" 100%"></textarea>

    Javascript:
    var oFCKeditor = new FCKeditor('content');  // content为textarea的id
    oFCKeditor.BasePath = "../FCKeditor/"// editor跟路径
    oFCKeditor.Height = "100%"// 高度度设置
    oFCKeditor.Width = "100%"// 宽度度度设置
    oFCKeditor.ToolbarSet = "None"// 工具条设置
    oFCKeditor.Config["ToolbarStartExpanded"= false// 属性配置
    oFCKeditor.ReplaceTextarea();
    2. 操作编辑器
    取得对象:
    var oEditor = FCKeditorAPI.GetInstance('content ');

    取得名字:
    var editorName = oEditor.Name;

    取得内容:
    var content =  oEditor.GetXHTML(true);

    设置内容:
    oEditor.SetHTML(‘html’);

    插入内容到当前光标处:
    oEditor.InsertHtml(‘html’);

    更新内容到textarea:
    oEditor.UpdateLinkedField();

     要点:
    Fckeditor所有方法和属性的第一个单词的首字母都是大写

    3. 有用事件


    编辑器加载完毕后会自动调用名字为FCKeditor_OnComplete的函数,并将自身作为参数传递进去,一般在FCKeditor_OnComplete函数初始化编辑器

    function FCKeditor_OnComplete(editorInstance)
    {
        
    // init code
        alert(editorInstance.Name) ;
    }


    ---------------------------------------------
    生活的意义并不是与他人争高下,而在于享受努力实现目标的过程,结果是对自己行动的嘉奖。
    ↑面的话,越看越不痛快,应该这么说:

    生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
  • 相关阅读:
    zabbix短信网关调用问题总结
    zabbix短信接口调用
    Windows Open with Sublime Text
    [转载]windows下安装Python虚拟环境virtualenvwrapper-win
    Resilio-sync auto restart
    django-orm-standalone
    RabbitMQ笔记
    RabbitMQ启动出错:- unable to connect to epmd on xxxx: timeout (timed out)
    [Python笔记]第十六篇:web框架之Tornado
    [前端笔记]第三篇:JavaScript
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/1125478.html
Copyright © 2011-2022 走看看