我是靠谱客的博主 高贵胡萝卜,这篇文章主要介绍js null undefined 空区别说明,现在分享给大家,希望可以做个参考。

null,对象不存在
var ii= document.getElementById("id");
alert(ii);
当前页面不存在id对象

   undefined
   var i;
alert(i);
  声明的变量没有初始化
   alert(document.oiji);
   或者对象属性,方法不存在

   空
   <asp:TextBox ID="name" runat="server" Width="100px" Text=""></asp:TextBox>
var iab = document.getElementById("name").value;
alert(iab);
   id=name的值为空

最后

以上就是高贵胡萝卜最近收集整理的关于js null undefined 空区别说明的全部内容,更多相关js内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(191)

评论列表共有 0 条评论

立即
投稿
返回
顶部