我的问题是我不明白为什么这个覆盖在这里不起作用是源
window.onload=function()
{
function Person(first,last)
{
this.First=first;
this.Last = last;
this.Full=function()
{
return this.First+" "+this.Last;
};
}
Person.prototype.GetFullName=function()
{
return this.First + " " + this.Last;
} ;
function Employee(first,last,position)
{
Person.call(this,first,last);
this.Position=position;
}
/* Employee.prototype = new Person();
var t = new Employee("Mohamed","Zaki","Web Developer");
alert(t.GetFullName());
*/
Employee.prototype.GetFullName=function()
{
var x = Person.prototype.GetFullName.call(this);
return x + " , " + this.Position ;
}
var e = new Employee("Mohamed","Zaki","Web Developer");
alert(e.GetFullName());
}