fckeditor替换编辑区后如何获得输入文字

cocofuyi 2009-06-02 09:14:48
<script language="javascript">
<!--
function checkForm(){

var Content =FCKeditorAPI.GetInstance("content").GetXHTML();
if(Content==null||Content=="")
{
alert('内容不能为空');
return(false);
form1.EditorDefault.focus();
}
return true;
}
-->
</script>
先谢谢!!大哥你给我的答案,Content得到的是带XHTML的标签,怎样获得里面的文本信息!!过滤掉标签。。。

例如:<p><b><font size=25>Content得到的是带XHTML的标签</font></b></p>
获得的应是:Content得到的是带XHTML的标签。
麻烦大哥了,在线等呀!!
...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cocofuyi 2009-06-02
  • 打赏
  • 举报
回复
谢谢大哥!!麻烦你了。。。。。。
lihan6415151528 2009-06-02
  • 打赏
  • 举报
回复
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);
}

10,608

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧