SoFunction
Updated on 2025-04-13

FCK determines whether the content is empty (if it is just a space, then this method is wrong)


//Judge whether the content of fck is empty
var oEditor = ('content'); //The content here is the ID value of the FCK
if(GetLength("content")<=0) {
alert('The content cannot be empty!');
();
return false;
}


function GetLength(str){
var oEditor = (str) ;
var checkContent= ;
var contentLength ;
if ( ){
contentLength= ().length ;
}
else{
var r = () ;
( ) ;
contentLength= ().trim().length ;
}
return contentLength;
}

//Remove the spaces of the string
= function()
{
return (/(^[\s]*)|([\s]*$)/g, "");
}