FCKEditor網(wǎng)頁編輯器 幾點(diǎn)使用心得
更新時(shí)間:2009年10月27日 22:08:56 作者:
FCKEditor網(wǎng)頁編輯器 幾點(diǎn)使用心得,需要的朋友可以參考下。
1、掛接事件,比如onkeydown事件,要在FCKeditor_OnComplete里實(shí)現(xiàn):
function FCKeditor_OnComplete( editorInstance )
{
if (document.all) // IE
editorInstance.EditorDocument.attachEvent("onkeypress", FCKeditor_OnKeyup) ;
else// other browser
editorInstance.EditorDocument.addEventListener( 'onkeypress', FCKeditor_OnKeyup, true );
}
2、掛接后如果調(diào)用了fckeditor的SetHTML函數(shù),則掛接事件會失效,要改用oEditor.EditorDocument.body.innerHTML來設(shè)置內(nèi)容即可。
3、用window.event.keyCode只能取到null值,要用FCKeditorAPI.GetInstance('FCKeditor1').EditorWindow.event.keyCode。
4、按回車符后生成的是是<br>還是<p>由fckconfig.js文件里的FCKConfig.EnterMode/FCKConfig.ShiftEnterMode決定,也可動態(tài)設(shè)置但屬性名不是FCKConfig,而是Config。
復(fù)制代碼 代碼如下:
function FCKeditor_OnComplete( editorInstance )
{
if (document.all) // IE
editorInstance.EditorDocument.attachEvent("onkeypress", FCKeditor_OnKeyup) ;
else// other browser
editorInstance.EditorDocument.addEventListener( 'onkeypress', FCKeditor_OnKeyup, true );
}
2、掛接后如果調(diào)用了fckeditor的SetHTML函數(shù),則掛接事件會失效,要改用oEditor.EditorDocument.body.innerHTML來設(shè)置內(nèi)容即可。
3、用window.event.keyCode只能取到null值,要用FCKeditorAPI.GetInstance('FCKeditor1').EditorWindow.event.keyCode。
4、按回車符后生成的是是<br>還是<p>由fckconfig.js文件里的FCKConfig.EnterMode/FCKConfig.ShiftEnterMode決定,也可動態(tài)設(shè)置但屬性名不是FCKConfig,而是Config。
相關(guān)文章
常用的HTML富文本編譯器UEditor、CKEditor、TinyMCE、HTMLArea、eWebEditor、Ki
這篇文章主要介紹了常用的HTML富文本編譯器UEditor、CKEditor、TinyMCE、HTMLArea、eWebEditor、KindEditor簡介,需要的朋友可以參考下2017-03-03FCK判斷內(nèi)容是否為空(如果只是去空格,那么這種方式是錯(cuò)誤的)
一般來說,像input里面的值都可以通過將內(nèi)容去空格判斷是否為空,但是FCK沒那么簡單,因?yàn)楫?dāng)你多打幾個(gè)空格或者多打一些回車,它會自動地生成一些<p>標(biāo)簽,如果再用原先去空格判斷的方法,顯然是不可取的。2010-12-12FCKEditor 表單提交時(shí)運(yùn)行的代碼
我們在使用fckeditor進(jìn)行提交的時(shí)候,會運(yùn)行的代碼,方便我們增加功能等。2009-06-06