Many times there's a need to call the parent method from the extended
class object.
This can be done easily by adding the $parent to be used inside
Object.extend() method.

var A = Class.create();
A.prototype = {
   show: function() {
      alert("I am A");
var $parent = Object.clone(A.prototype);
for (var i in $parent) alert(i+":\n"+$parent[i]);
   show: function() {
      alert("I am EXTENDED A");


Is there a way to make $parent variable a pre-defined variable for
every call to Object.extend() ?

-thanks, Eli

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to