日期:2014-05-16 浏览次数:20398 次
function A() {
this.name = "a";
}
function B() {
this.age = 30;
}
B.prototype = new A();
var b1 = new B();
var b2 = new B();
alert(b1.name);
alert(b2.name);
function A() {
this.name = "a";
}
function B() {
var k,value;
for( k in this){
value = this[k];
if(typeof value == 'string'){
this[k]=value;
}
}
this.age = 30;
}
B.prototype = new A();
var $b1 = new B();
var $b2 = new B();