直插代码!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);

解决方案 »

  1.   

    额。。哪里BT?只不过self一直返回本身函数而已。。
      

  2.   

    好吧,我换一段你们就知道了: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);
      

  3.   

    上面那段没改过的,看下段:function test(){
        this.self=(function(a){
                       alert(a);
                       return this.self;
                   });
    }
    t=new test();
    t.self(1)(2)(3)(4)(5)(6);
      

  4.   

    有点意思。不同作用域下this的含义+闭包应用。
      

  5.   

    这一段(2)之后this绑定在window上。。执行不下去
      

  6.   

    这一段(2)之后this就绑定到window上了,执行不下去的
      

  7.   

     this.self=(function(a){
                       alert(a);
                       return tmp.self;
                   });
    而且这里,这个括号完全是没用的。。加不加都是一样的。。“=”已经代表右边是个表示式
      

  8.   


    只是个方法链。何必这么复杂,还需要new个啥var fn = function(a){
        alert(a);
        return arguments.callee;
    }
      

  9.   

    function test(){
        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]);
    这样就可以解决啦!!!!