不解的问题是: null 和 undefined 有何区别
function fun1(p1){
//在这个function中,p1已经存在
alert(p1==null); //如果fun1(), 这两个都会是true
alert(p1==undefined);
}
//底下两句会抛出RefferenceError
alert(w==null);
alert(w==undefined);
//使用Ext 来测试 null或undefined, 不过仍然会抛出 RefferenceError
Ext.isEmpty(w)
//对于一个从未出现过的变量, 必须使用typeof(v)来测试undefined, 下面这句为true, 注意'undefined'是字符串
typeof(w)=='undefined'
-----------------------------------------------------------------------
var x;
alert(x==null); //true
alert(x==undefined); //true