摘要:
比如一个方法:slideUp(参数,回调函数);由于头脑比较痴呆,所以都搞不明白是怎么写的;今天偶尔看到了,让我明白了。恍然,还挺简单的;例如:window.onload = function(){ test({top:"11px", left:"12px", bottom:"13px"}, function(){ alert("已经执行完成");})}//定义function test(json, callback){ for(j in json){ alert(json[j]); } if(callback){
阅读全文
摘要:
看以with用法,感觉很实用,就蛮写了下;with:为一个或一组 属性或方法 指定默认对象形式:with(对象){ 单写属性或方法}例:var test = function(){ this.str1 = "width test1"; this.str2 = "width test2";//这里需使用this};test.prototype.method = function(){ alert("method");}window.onload = function(){ var t = new test(); alert(t.str1
阅读全文