1 判断字符串为空
(1)第一种方法
var test="";if(test==""||test==null||test==undefined){alert("为空");}
(2)第二种方法
var test="";if(!test){alert("为空");}
2 判断字符串不为空
(1)第一种方法
var test="";if(test!=""&&test!=null&&test!=undefined){alert("不为空");}
(2)第二种方法
var test="";if(!!test){alert("不为空");}
旭东怪的个人空间_哔哩哔哩_Bilibili旭东怪,人生低谷不可怕,可怕的是坚持不到人生转折点的那一天;旭东怪的主页、动态、视频、专栏、频道、收藏、订阅等。哔哩哔哩Bilibili,你感兴趣的视频都在B站。/484264966?spm_id_from=333.1007.0.0