一个变量为空,要么是null,要么是‘’ 因为null在jquery不是关键字,所以要用下面这种判断 var str=''; if(str ==‘null’ || str == ‘’){ alert("变量str为空!!"); }