如何判断FCKEditor的值是否为空?

来源:百度知道 编辑:UC知道 时间:2024/06/07 09:29:19
如何判断FCKEditor的值是否为空?
如果在用户在填入内容的时候提交就提示用户
如果用户输入了就提交到服务端写入

判断内容是不是空以及其他配置

<script type="text/javascript">
<!--
// 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 ='/fckeditor/';
var oFCKeditor = new FCKeditor( 'news_content' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 400 ;
oFCKeditor.Width = 600 ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
//-->
//取fck内容的长度
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 ;
}