JavaScript--判断字符是否为空

js代码:

//判断字符是否为空的方法
function IsEmpty(res){
    if(typeof res== "undefined" || res== null || res== ""){
        return true;
    }else{
        return false;
    }
}

js调用:

if (!IsEmpty(value)) {
    alert(value);
}
原文地址:https://www.cnblogs.com/dcy521/p/11386709.html