摘要: 1.对象冒泡关键字this引用的是构造函数当前创建的对象,不过在这个方法中,this指向的是所属的对象把ClassA作为常规的函数来建立继承机制。 1 function ClassA(sColor) 2 { 3 this.color=sColor; 4 this.sayColor=function(){ 5 alert(this.color); 6 }; 7 } 8 9 10 11 function ClassB(sColor){12 this.newMethod=ClassA;13 ... 阅读全文
posted @ 2013-07-11 08:53 returnKing 阅读(161) 评论(0) 推荐(0) 编辑