摘要: call() 方法它的第一个参数用作this的对象,其他参数都直接传递给函数自身;重写上个例子:function ClassA(sColor){ this.color = sColor; this.sayColor = function(){ alert(this.color) }};function ClassB(sColor,sName){ ClassA.call(this,sColor)//这里的this 是指ClassB this.name = sName; this.sayName = function(){ a... 阅读全文
posted @ 2012-01-09 14:45 noyobo 阅读(261) 评论(0) 推荐(0) 编辑