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;
}
}
原文:https://blog.51cto.com/u_15639793/5297505