this通常指当前对象,如果在其他所有对象的上下文之外使用 this,则它指的是 window 对象。

解决方案 »

  1.   

    this 就是这个,指的是当前!class 我{
         方法;//谁的方法?
    this.方法;//我的方法!
    }
      

  2.   

    那上面的代码是不是就可以理解成这样?var aa = {
    makeDraggable : function(group) {
    group.setDrag = aa.setDrag;
    },

    setDrag : function(handle) {
    if(handle && handle != null)
    group.setDrag.handle = handle;
    else
    group.setDrag.handle = group.setDrag;

    group.setDrag.handle.group = group.setDrag;
    }
    }
      

  3.   

    this相当于是aa,我是这样理解的
      

  4.   

    这么说我上面的理解错了?应该是这样?var aa = {
    makeDraggable : function(group) {
    group.setDrag = aa.setDrag;
    }setDrag : function (handle) {
    if (handle && handle != null) {
    aa.handle = handle;
    else
    aa.handle = aa;

    aa.handle.group = aa;
    }
    }