67,512
社区成员
发帖
与我相关
我的任务
分享
function commitForm(){
if(/^\s*$/.test((FCKeditorAPI.GetInstance("news.ncontent").EditorDocument.body.innerText))){
alert("内容不得为空");
return false;
}
}
<!-- fckeditor -->
<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 = "<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/fckeditor/"%>"
var oFCKeditor = new FCKeditor( 'news.ncontent' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
<!-- end of fvkeditor -->