最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

FCKEDITOR 相關(guān)函數(shù)介紹

 更新時(shí)間:2010年07月26日 14:30:25   作者:  
FCKeditorAPI是FCKeditor加載后注冊(cè)的一個(gè)全局對(duì)象,利用它我們就可以完成對(duì)編輯器的各種操作。
獲取FCK的實(shí)例
FCKeditorAPI是FCKeditor加載后注冊(cè)的一個(gè)全局對(duì)象,利用它我們就可以完成對(duì)編輯器的各種操作。
在當(dāng)前頁(yè)獲得 FCK 編輯器實(shí)例:
var Editor = FCKeditorAPI.GetInstance('InstanceName');
從 FCK 編輯器的彈出窗口中獲得 FCK 編輯器實(shí)例:
var Editor = window.parent.InnerDialogLoaded().FCK;
從 框架頁(yè)面的子框架中獲得其它子框架的 FCK 編輯器實(shí)例:
var Editor = window.FrameName.FCKeditorAPI.GetInstance('InstanceName');
從頁(yè)面彈出 窗口中獲得父窗口的 FCK 編輯器實(shí)例:
var Editor = opener.FCKeditorAPI.GetInstance('InstanceName');
FCK獲取焦點(diǎn)
獲 取焦點(diǎn)是否在FCK中:
oEditor.HasFocus
FCK獲取焦點(diǎn):
oEditor.Focus();// 獲取焦點(diǎn)
獲取和設(shè)置FCK的內(nèi)容
獲得 FCK 編輯器的內(nèi)容:
oEditor.GetXHTML(formatted); // formatted 為:true|false,表示是否按HTML格式取出。
設(shè)置 FCK 編輯器的內(nèi)容:
oEditor.SetHTML("content", false); // 第二個(gè)參數(shù)為:true|false,是否以所見(jiàn)即所得方式設(shè)置其內(nèi)容。
插入內(nèi)容到 FCK 編輯器:
oEditor.InsertHtml("html"); // "html"為HTML文本
檢查 FCK 編輯器內(nèi)容是否發(fā)生變化:
oEditor.IsDirty();
復(fù)制代碼 代碼如下:

// 獲取編輯器中HTML內(nèi)容
function getEditorHTMLContents(EditorName) {
var oEditor = FCKeditorAPI.GetInstance(EditorName);
return(oEditor.GetXHTML(true));
}

// 獲取編輯器中文字內(nèi)容
function getEditorTextContents(EditorName) {
var oEditor = FCKeditorAPI.GetInstance(EditorName);
return(oEditor.EditorDocument.body.innerText);
}

// 設(shè)置編輯器中內(nèi)容
function SetEditorContents(EditorName, ContentStr) {
var oEditor = FCKeditorAPI.GetInstance(EditorName) ;
oEditor.SetHTML(ContentStr) ;
}


FCK的事件處理

FCK 定義有OnComplete,OnBlur和OnFocus等事件,這樣就可以使用事件的處理函數(shù)完成相應(yīng)的處理。

FCK添加事件處理 函數(shù)的方法是:fckInstance.Events.AttachEvent( EventName, function)

代碼
//FCKeditor 加載完成后做處理的方法
function FCKeditor_OnComplete( editorInstance )
{
editorInstance.Events.AttachEvent( 'OnBlur' , FCKeditor_OnBlur ) ;
editorInstance.Events.AttachEvent( 'OnFocus', FCKeditor_OnFocus ) ;
}

function FCKeditor_OnBlur( editorInstance )
{
//失去焦點(diǎn)收起工具欄
editorInstance.ToolbarSet.Collapse() ;
}

function FCKeditor_OnFocus( editorInstance )
{

editorInstance.ToolbarSet.Expand() ;
}

相關(guān)文章

最新評(píng)論

静宁县| 乡宁县| 甘孜| 富宁县| 区。| 宝鸡市| 峨眉山市| 大名县| 昌宁县| 尼勒克县| 容城县| 镇宁| 莆田市| 龙口市| 泸定县| 岳西县| 桐乡市| 会宁县| 交口县| 明水县| 民乐县| 策勒县| 海南省| 鄂托克前旗| 安吉县| 江陵县| 搜索| 冷水江市| 临安市| 区。| 莲花县| 富平县| 平原县| 乐亭县| 东山县| 临高县| 竹溪县| 西安市| 苍南县| 吕梁市| 石泉县|