• 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) ;
    }


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

    生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
  • 相关阅读:
    如何度过每天的最初十分钟
    微软正在拿命做一场豪赌
    .htaccess用法与设置超详细讲解+大全
    互联网+情趣用品:羞答答的玫瑰静悄悄地开
    男人雄辩 女人聊天
    苹果手表会一直美下去
    移动应用大行其道:你的企业准备好了吗?
    微商的下一步会怎么走?
    阿里京东腾讯58的O2O格局,创业者的夹缝生存之道
    苹果首席设计师艾维:Apple Watch不是奢侈品
  • 原文地址:https://www.cnblogs.com/pengchenggang/p/1125478.html
Copyright © 2020-2023  润新知