欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

详细信息(js代码)

程序员文章站 2022-03-20 13:30:38
...
[size=medium][color=blue]
js文件[/color][/size]

//文档编辑器
function GetMessageLength(str)
{
var oEditor = FCKeditorAPI.GetInstance(str) ;
var oDOM = oEditor.EditorDocument ;
var iLength ;

if ( document.all ) // If Internet Explorer.
{
iLength = oDOM.body.innerText.length ;
}
else // If Gecko.
{
var r = oDOM.createRange() ;
r.selectNodeContents( oDOM.body ) ;
iLength = r.toString().length ;
}
// oEditor.InsertHtml('')
return iLength
}

function CheckPost(){
if(GetMessageLength("content")==0)
{
alert('内容不能为空');
return false;
}
return true;
}



[size=large][color=blue]html代码[/color][/size]

<!-- 内容 -->
<script type="text/javascript" src="<%=basePath %>fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = "<%=basePath%>fckeditor/";
var oFCKeditor = new FCKeditor( 'groupDet','620','500' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
<script type="text/javascript" src="<%=basePath%>js/checkFckEditor.js"></script>
相关标签: fckeditor HTML