function A(a,b)
{
this.a = a;
this.b = b;
}B.prototype.superclass = A;function B(a,b,c,d)
{
this.superclass(a,b);
this.c = d;
this.d = d;
}
这是书上的一个例子,但是我测试的时候说“this.superclass is not a function”,请问那里出了问题?
{
this.a = a;
this.b = b;
}B.prototype.superclass = A;function B(a,b,c,d)
{
this.superclass(a,b);
this.c = d;
this.d = d;
}
这是书上的一个例子,但是我测试的时候说“this.superclass is not a function”,请问那里出了问题?
function A(a,b)
{
this.a = a;
this.b = b;
}
B.prototype.superclass = A;
function B(a,b,c,d)
{
this.superclass(a,b);
this.c = d;
this.d = d;
}
var B1= new B(1,2,3,4);
alert(B1.a);//1
</script>