摘要: 1.区分undefined 和null: undefined: 表示一个对象没有被定义或者没有被初始化。 null:表示一个尚未存在的对象的占位符。undefined类型是从null派生来的,所以他们是想等的: alert(null==undefined) //true2.使用typeof运算符:typeof返回的是有个字符串,不是类型,所以 if(typeof oTemp ==undefined){...} //false 应改为: if(typeof oTemp ==’undefined‘){...} //truetypeof对各运算符返回的结果:un... 阅读全文
posted @ 2013-04-29 11:04 xiaohong_oath 阅读(226) 评论(0) 推荐(0) 编辑