日期:2014-05-16 浏览次数:20502 次
function Person(name, age, email){
this.name = name;
this.age = age;
this._email = email;
}
function _Person_show_me(){
alert('我叫' + this.name + ',我' + this.age + '岁了,我的email是' + this._email);
}
Person.prototype.show_me = _Person_show_me;
function Student(name, age, email, score){
Person.call(this, name, age, email);
this.score = score;
}
function _Student_show_score(){
alert("我的分数是:" + this.score);
}
Student.prototype = new Person();
Student.prototype.show_score = _Student_show_score;
var he = new Student('小何', 28, 'baijun.he@163.com', 80);
he.show_me();
he.show_score();