设立fckeditor为只读

设置fckeditor为只读

//设置fckeditor为只读
function FCKeditor_OnComplete(editorInstance)
    {
        editorInstance.EditorDocument.body.disabled = true;
        editorInstance.EditorWindow.parent.document.getElementById('xExpanded').style.display = 'none';
        editorInstance.EditorWindow.parent.document.getElementById('xCollapsed').style.display = 'none';
        editorInstance.EditorWindow.blur();
    }

 

本文来自****博客,转载请标明出处:http://blog.****.net/hailang43/archive/2009/06/20/4285847.aspx

 

 

/*设置FCKEDITOR为只读 */

function setFCKeditorReadOnly( editor ){ 
try{ 
editor.EditorDocument.body.contentEditable = false; 
editor.EditMode=FCK_EDITMODE_SOURCE; 
editor.ToolbarSet.RefreshModeState(); 
editor.EditMode=FCK_EDITMODE_WYSIWYG; 
editor.ToolbarSet.RefreshModeState(); 
editor.EditorWindow.parent.document.getElementById('xExpanded').style.display = 'none'; 
editor.EditorWindow.parent.document.getElementById('xCollapsed').style.display = 'none'; 
editor.EditorWindow.blur(); 
} 
catch(e){ 
} 
}

 

1 楼 天打五雷轰 2010-12-10  
    设置只读的这些代码放在$(document).ready(function(){})中有些代码不能执行,同样的问题也出现在获取和设置fckeditor内容中,GetXGTML和SetGTMHL无法执行,但是如果设置一个按钮,点击执行这段代码是可以完成这些功能的,我第一次接触fckeditor,不知道这是哪的问题?情指点指点