FCKEditor API

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()

你可能感兴趣的:(JavaScript,html,linux,fckeditor)