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 标签 res