直插代码!function test(){
var tmp=this;
this.self=(function(a){
alert(a);
return tmp.self;
});
}
t=new test();
t.self(1)(2)(3)(4)(5)(6);
var tmp=this;
this.self=(function(a){
alert(a);
return tmp.self;
});
}
t=new test();
t.self(1)(2)(3)(4)(5)(6);
var tmp=this;
this.self=(function(a){
alert(a);
return tmp.self;
});
}
t=new test();
t.self(1)(2)(3)(4)(5)(6);
this.self=(function(a){
alert(a);
return this.self;
});
}
t=new test();
t.self(1)(2)(3)(4)(5)(6);
alert(a);
return tmp.self;
});
而且这里,这个括号完全是没用的。。加不加都是一样的。。“=”已经代表右边是个表示式
只是个方法链。何必这么复杂,还需要new个啥var fn = function(a){
alert(a);
return arguments.callee;
}
this.self=(function(a){
alert(a);
return this.self;
});
}
t=new test();
t.self(1)(2)(3)(4)(5);
t.self(1).call(t,[2]).call(t,[3]);
这样就可以解决啦!!!!