zoukankan      html  css  js  c++  java
  • js中获取和设置Fckeditor的值

    // 获取编辑器中HTML内容 
    function getEditorHTMLContents(EditorName) { 
    var oEditor 
    = FCKeditorAPI.GetInstance(EditorName); 
    return(oEditor.GetXHTML(true)); 


    // 获取编辑器中文字内容 
    function getEditorTextContents(EditorName) { 
    var oEditor 
    = FCKeditorAPI.GetInstance(EditorName); 
    return(oEditor.EditorDocument.body.innerText); 


    // 设置编辑器中内容 
    function SetEditorContents(EditorName, ContentStr) { 
    var oEditor 
    = FCKeditorAPI.GetInstance(EditorName) ; 
    oEditor.SetHTML(ContentStr) ; 
    }
    <script type="text/javascript" language="javascript"> 
        function a()
        {
                
    //得到控件的html
                 var checkContent =FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML();
                alert(checkContent);
                
    //得到html的长度
                 var len = FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML().length;
                alert(len);
                
    //得到fck控件
                var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
                
    //得到编辑器中的文字
                var text = oEditor.EditorDocument.body.innerText;
                alert(text);
                
    //让编辑器得到焦点
                oEditor.Focus();
        }
        
    </script>
    editor 
    = FCKeditorAPI.GetInstance('news_content');//comment是设置的instanceName值.
    var Frame = editor.EditorDocument.body.innerHTML;
  • 相关阅读:
    Google-C++编码规范中文版.pdf
    100个gdb小技巧(v1.0).pdf
    NSIS 3.0 发布,Windows 安装程序制作工具
    python爬取各类文档方法归类汇总
    【转】openwrt中ubus
    OpenWrt源码分析之ubus
    详解C语言中的fopen()函数和fdopen()函数
    IPsec技术介绍(转)
    mxml 详解
    Delphi IDE Theme Editor, Delphi IDE 主题编辑器,支持D7~Rad Studio 10.3 RIO及Lazarus
  • 原文地址:https://www.cnblogs.com/shizhi57/p/2095226.html
Copyright © 2011-2022 走看看