我想要做的是从and继承id
and并覆盖. 我想知道这是否是在 JavaScript 中实现继承的标准方法。name
TField
render
TField
var TField=function(jData)
{
this.id=jData.id;
this.name=jData.name;
this.attributes=jData.attributes;
this.render=function(){
alert('TField render.');
};
};
var TChildField=function(jData)
{
var t= new TField(jData);
t.render=function(){
alert('TChildField render.');
}
return t;
}
var tobj={id:"1",name:"test",attribute:{}};
var c= new TChildField(tobj);
alert(c.id);
alert(c.name);