js判断字符串是否为空,多个空格也算为空
String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ''); } function isEmpty(obj) { if (typeof obj === "undefined" || obj == null || obj.trim() == "") { return true; } else { return false; } }
String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ''); } function isEmpty(obj) { if (typeof obj === "undefined" || obj == null || obj.trim() == "") { return true; } else { return false; } }