//判断字符是否为空的方法 function isEmpty(obj){ var regu = "^[ ]+$"; var re = new RegExp(regu); if(typeof obj == "undefined" || obj == null || obj == "" || re.test(obj)){ return true; }else{ return false; } }