KindEditor如何取编辑器内容的第一段,用来当作文章的内容摘要

hero88 发布于 2012/03/06 13:55
阅读 954
收藏 0
KindEditor如何取编辑器内容的第一段,用来当作文章的内容摘要,哪个朋友做过请给个建议,谢谢!

以下是问题补充:

@hero88:从网上找了下资料,所需要的内容取到了,但是还有个问题是引用了kindeditor编辑器后,文本域中onblur事件没法使用,我用kindeditor版本是3.5,从官网上看4.0之后有对应的函数,请问3.5版如何用onblur事件? (2012/03/06 16:08)
加载中
0
voov
voov
与编辑器无关,程序中自动截取
0
hero88
hero88

从网上找了下资料,所需要的内容取到了,但是还有个问题是引用了kindeditor编辑器后,文本域中onblur事件没法使用,我用kindeditor版本是3.5,从官网上看4.0之后有对应的函数,请问3.5版如何用onblur事件?

//取编辑器内容第一段,设置为内容摘要
function getKindEditorHTMLContents(EditorName) {
 var problemContent = KE.util.getPureData(EditorName);
 //alert(problemContent);
 //KE.util.escape(html);转换HTML里的特殊字符。    
 //problemContent = KE.util.escape(problemContent);
 //problemContent是一个要去除html标记的文档
 problemContent = problemContent.replace(/<[^>]+>/g,"");
 problemContent = problemContent.split("\n")[0];
 $("#zy").val(problemContent);//第一段内容
}

 

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部