手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js null undefined 空区别说明
js null undefined 空区别说明
摘要:null,对象不存在varii=document.getElementById("id");alert(ii);当前页面不存在id对象und...

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 空区别说明】相关文章:

JavaScript中继承用法实例分析

动态提示的下拉框

Jquery注册事件实现方法

window.onload与$(document).ready()的区别分析

由ReactJS的Hello world说开来

javascript委托(Delegate)blur和focus用法实例分析

TypeError document.getElementById(...) is null错误原因

微信浏览器内置JavaScript对象WeixinJSBridge使用实例

jquery使用each方法遍历json格式数据实例

一条一条新闻向上的滚动 不错

精品推荐
分类导航