On 18 March 2011 11:43, Luke <[email protected]> wrote: > Hi, > I'm working on my bachelor-thesis and I'm trying to understand a few things. > I'm wondering: Why is there the construct of the $super-parameter in > Prototype's class-implementation? Is anything wrong with calling > this.parent.myfunction()? Why did they implement that? > This is more of a theoretical question.. I just think there must be a reason > for the $super thing.. > Does anyone have an idea? > Thanks > Lukas > > -- > 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. >
parent relates to the DOM which is an object orientated model. Javascript classes are not OOP, but prototypes. As such "parent" is not appropriate. To simulate "parent" in PrototypeJS, $super was defined. http://prototypejs.org/learn/class-inheritance -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- 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.
