using value.length != 0..不适用于空白空间的情况
value.length != 0
尝试这个:
if (value.match (/\S/)) { ... }
它将确保value至少有 1 个非空白字符
value