js判断输入项是否为空的校验
//判断数据是否为空,null,"",undifind," ",返回结果为空返回true,否则返回false
function checkInput(data){
if (data == null || data == undefined || data == ""){
return true;
}
if (typeof data == "string") {
var result =data.replace(/(^\s*)|(\s*$)/g, "");
return result.length == 0 ? true : false;
}else{
return false;
}
}