FCK 编辑器取值

xiaoxiao2022-06-12  33

1、获取编辑器中HTML内容, 存在空格符、换行符等 function getEditorHTMLContents(EditorName){ var oEditor = FCKeditorAPI.GetInstance(EditorName); return(oEditor.GetXHTML(true)); } 2、获取编辑器中文字内容(无html代码),就是不存在空格符、换行符等 function getEditorTextContents(EditorName){ var oEditor = FCKeditorAPI.GetInstance(EditorName); return(oEditor.EditorDocument.body.innerText); } 3、设置编辑器中内容 function SetEditorContents(EditorName, ContentStr){ var oEditor = FCKeditorAPI.GetInstance(EditorName) ; oEditor.SetHTML(ContentStr) ; } 相关资源:Java 面经手册·小傅哥(公众号:bugstack虫洞栈).pdf
转载请注明原文地址: https://www.6miu.com/read-4933864.html

最新回复(0)