`

FCKEditor API

    博客分类:
  • J2EE
阅读更多

http://www.lslnet.com/linux/dosc1/30/linux-240174.htm

 

function GetXHTML(format)
其中,format为布尔值,表示是否返回格式化过的HTML.
根据我的经验,GetHTML一般都是不行的,要用GetXHTML.

与此对应的
设置Editor的内容
* function SetHTML(html, forceWYSIWYG)

eg.
...
var oEditor = FCKeditorAPI.GetInstance('InstanceName') ;  
var  strContent = oEditor.GetXHTML('true');
...



其他:
FCKeditor offers a complete JavaScript API so you can interact with it once the editor is loaded and running.



var oEditor = FCKeditorAPI.GetInstance('InstanceName') ;   //Instancename就是括号里那个名字.

The GetInstance method returns the main FCKeditor object that gives the necessary bridge to interact with it. This is a list of properties and methods of this object:
* Description = string
* EditMode = Integer
* Name = string
* Status = Integer

* function AttachToOnSelectionChange(functionPointer)
* function CleanAndPaste(html)
* function CreateElement(tag)
* function CreateLink(url)
* function ExecOnSelectionChange()  //Fires OnSelectionChange event in event manager
* function ExecOnSelectionChangeTimer()
* function ExecuteNamedCommand(commandName, commandParameter)
* function ExecuteRedirectedNamedCommand(commandName, commandParameter)
* function Focus()
* function GetHTML(format)          // doesnt work. Use GetXHTML instead.
* function GetNamedCommandState(commandName)
* function GetNamedCommandValue(commandName)
* function GetXHTML(format)
* function InitializeBehaviors()
* function InsertElement(element)
* function InsertElementAndGetIt(e)
* function InsertHtml(html)
* function MakeEditable()
* function OnDoubleClick(element)
* function Paste()
* function PasteAsPlainText()
* function PasteFromWord()
* function Preview()
* function RegisterDoubleClickHandler(handlerFunction, tag)
* function SetHTML(html, forceWYSIWYG)
* function SetStatus()
* function ShowContextMenu(x, y)
* function SwitchEditMode()
* function UpdateLinkedField()

分享到:
评论

相关推荐

    fckeditor api

    FCKeditor API 是一个强大的富文本编辑器接口,主要用于网页内容的编辑与管理。这个API提供了丰富的功能,允许开发者在网页上实现类似Word的文本编辑体验。以下是对FCKeditor API的一些关键知识点的详细说明: 1. *...

    FCKeditorAPI 手册 js操作获取等

    FCKeditorAPI是一套可以对FCKeditor(一款流行的网页所见即所得编辑器)进行JavaScript编程的API。通过这个API,开发者可以使用JavaScript来控制和操作FCKeditor编辑器。FCKeditor(之后被CKEditor替代)是一个富...

    FCKeditor_API使用详解

    var Editor = window.FrameName.FCKeditorAPI.GetInstance('InstanceName'); ``` - **从页面弹出窗口中获取父窗口的FCK编辑器实例**: ```javascript var Editor = opener.FCKeditorAPI.GetInstance('Instance...

    FCKeditor_API使用详解.pdf

    - 在子框架中,通过`window.FrameName.FCKeditorAPI.GetInstance('InstanceName')`访问其他子框架的实例。 - 从弹出窗口访问父窗口的实例,用`opener.FCKeditorAPI.GetInstance('InstanceName')`。 3. **编辑器...

    fckeditor javascript api

    需要注意的是,在页面加载过程中,`FCKeditorAPI`对象不可用,因此需要等待编辑器加载完成之后才能使用。 ##### 从外部脚本获取实例 当你在页面中放置编辑器时,会给编辑器分配一个“实例名称”。为了获取该实例,...

    javascript获取FCKeditor内容

    var oEditor = FCKeditorAPI.GetInstance(EditorName); return (oEditor.GetXHTML(true)); } ``` 在这个函数中,首先通过`GetInstance`方法获取指定名称的编辑器实例,然后调用`GetXHTML`方法获取HTML格式的内容...

    FCKeditor获取选中内容的JS

    FCKeditor提供了一个名为`FCKeditorAPI`的对象,通过这个对象我们可以访问编辑器的各种功能。获取选中内容的函数是`FCKeditorAPI.Selection.GetSelectedHtml()`。这个函数会返回一个字符串,包含当前选中的HTML代码...

    request_and_set_FCKeditor_value.rar_fckeditor val_javascript

    例如,如果我们有一个编辑器实例的ID是"FCKeditor1",那么我们可以通过`window.FCKeditorAPI`访问它。 **获取FCKeditor的值** 要获取FCKeditor中的内容,我们可以使用FCKeditorAPI的`GetHTML()`方法。这个方法返回...

    javascript获取FCKeditor内容.pdf

    首先,FCKeditor在页面加载完成后会注册一个全局对象`FCKeditorAPI`,通过这个对象我们可以访问并控制FCKeditor实例。获取FCKeditor实例的基本语法是: ```javascript var oEditor = FCKeditorAPI.GetInstance('...

    javascript获取FCKeditor内容[文].pdf

    以下是对FCKeditorAPI的详细解释以及如何通过JavaScript获取和设置其内容: 1. **FCKeditorAPI**: FCKeditorAPI是一个全局JavaScript对象,它在FCKeditor加载后自动创建。这个对象提供了多种方法,让我们能够控制...

    JS操作Fckeditor的一些常用方法(获取、插入等)

    var oEditor = FCKeditorAPI.GetInstance(EditorName); return oEditor.GetXHTML(true); } ``` 这里`GetXHTML(true)`会返回格式化的HTML代码,如果传入`false`,则返回未格式化的HTML。 - **获取纯文本内容**: `...

    winform集成fckeditor编辑器

    string editorContent = webBrowser1.Document.InvokeScript("eval", new object[] { "FCKeditorAPI.GetInstance('myEditor').GetHTML()" }); ``` 设置内容: ```csharp webBrowser1.Document.InvokeScript(...

    fckeditor的MVC版及js使用fckeditor的方法

    var editor = FCKeditorAPI.GetInstance('myEditor'); var htmlContent = editor.GetValue(); // 获取编辑器中的HTML内容 ``` 然后,可以将`htmlContent`发送到服务器进行存储或处理。 除了基础用法,FCKeditor还...

    FCKeditor在线文本编辑器使用

    例如,通过`FCKeditorAPI.Create()`方法可以创建一个新的编辑器实例,`FCKeditorAPI.GetInstance()`则可以获取已存在的编辑器实例。此外,还可以使用API进行事件监听、获取或设置编辑器内容等操作。 ### 3. 插件...

    javascript获取FCKeditor内容.txt

    var oEditor = FCKeditorAPI.GetInstance('content'); ``` 该方法用于获取指定ID的FCKeditor实例。这里的`'content'`是编辑器实例的ID,通常与HTML元素的ID相对应。 ##### 2. 获取编辑器内容 ```javascript var ...

    FCKeditor2.6.4使用说明

    - `FCKeditorAPI`提供了丰富的API接口,允许开发者对编辑器进行高级定制。 6. **兼容性与性能** - FCKeditor2.6.4支持主流浏览器,如IE6+、Firefox、Chrome、Safari等,但可能不兼容较新浏览器的某些特性。 - ...

    FCKeditor使用指南

    ##### 3.3 FCKeditor API 调用 - 提供了一系列API接口,用于与FCKeditor交互。 - **适时打开编辑器**:可以在特定事件触发时打开编辑器。 #### 4. 修改FCKeditor的配置 ##### 4.1 方法一:修改fckconfig.js文件 ...

    FCKEditor与ext结合使用

    var content = FCKeditorAPI.GetInstance('fckeditor').GetHTML(); // 将content保存到服务器或EXT的数据模型中 }; ``` **6. 注意事项** - 由于FCKeditor和EXT都是JavaScript库,所以需要考虑兼容性和加载顺序。 ...

    FCKeditor demo(用JS方式)

    var oEditor = FCKeditorAPI.GetInstance('editor') ; oEditor.InsertHtml('<img src="image.jpg" alt="Image Description"/>' ) ; ``` 此外,FCKeditor还提供了事件监听机制,允许你在编辑器的特定事件(如文本...

    fckeditor中添加自动排版功能

    var editor = FCKeditorAPI.GetInstance('FCKeditor1'); // 假设编辑器实例的ID为'FCKeditor1' var html = editor.GetHTML(); // 使用正则表达式或其他方法对html进行处理,实现自动排版 var formattedHtml = ...

Global site tag (gtag.js) - Google Analytics