0
点赞
收藏
分享

微信扫一扫

【Vue/Js】如何判断json对象为空或undefined未定义?(已解决)


用: typeof 变量名,判断是否undefined(未定义)

if (typeof m_json === 'undefined') {
          alert("字符串为空");
          return;
        }else{
          alert("字符串不为空");
        }

举报

相关推荐

0 条评论