// my code :
var Parent = Class.create({
intro:{
name:'',
age:0
},
initialize:function(){},
show:function(){
document.write(this.intro.name);
}
});
var ChildA = Class.create(Parent, {
initialize:function(){
this.intro.name = 'A';
this.intro.age = 10;
}
});
var ChildB = Class.create(Parent, {
initialize:function(){
this.intro.name = 'B';
this.introl.age = 20;
}
});
ex1)
var a = new ChildA();
var b = new ChildB();
a.show(); // => print 'B' <<<< I can't understand..:(
b.show(); // => print 'B'
ex2)
var b = new ChildB();
var a = new ChildA();
a.show(); // print 'A'
b.show(); // print 'A' <<<< I can't understand..:(
//=========================
Why do these problems occur?
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.