sunney2012 发表于 2013-1-22 22:36:30

JS继承

function Base(name){this.name = name;this.getName = function(){return this.name;}}function Child(id){this.id = id;this.getId = function(){return this.id;}}Child.prototype = new Base('base');var ch = new Chilc('child');alert(ch.getId());alert(ch.getName());
页: [1]
查看完整版本: JS继承