function isnull(val){ var str=val.replace(/(^\s*)|(\s*$)/g, "");//清空前后的空格 if(str == "" || str == undefined || str == null) return true; else return false; }