js和java判断值为空的方式 js方式判断值为空: name == ""; java方式判断值为空: name==null || name.trim().isEmpty();注:name==null要在前面,不然可能会报空指针异常。