« flate | 首页 | pongba »

jun

留言(5 条)

Javascript面向对象编程(二):构造函数的继承 留言:

function Animal() {
this.species = "动物";
}
function Cat(name, color) {
this.name = name;
this.color = color;
}
function extend(Child, Parent) {
var F = function() { };
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
}
extend(Cat, Animal);
var cat1 = new Cat("大毛", "黄色");
alert(cat1.species); // 结果是undefined\
取不到"动物" 值

Javascript面向对象编程(二):构造函数的继承 留言:

Child.uber = Parent.prototype;
这样写有什么好处... 不是很理解

【活在中国】谁是恶意软件? 留言:

我现在比较喜欢用360杀毒软件。

我要翻译Paul Graham了 留言:

期待你的作品,加油!

卡尔维诺中文站留言板 留言:

去年看了这个网站,今年再来的时候,风格一新,别样的感受。。。。。祝您的网站越办越好