This link has been bookmarked by 156 people . It was first bookmarked on 20 Mar 2008, by alfred westerveld.
-
11 May 12
-
07 May 12
-
04 Apr 12
-
05 Mar 12
-
27 Feb 12
-
22 Feb 12
-
20 Feb 12
-
08 Feb 12
-
24 Jan 12
-
21 Jan 12
-
15 Jan 12
-
13 Jan 12
-
12 Jan 12
-
11 Jan 12
-
15 Oct 11
-
03 Oct 11
-
29 Sep 11
-
25 Sep 11
-
16 Sep 11
-
11 Sep 11
Troy SabinI've been doing a lot of work, lately, with JavaScript inheritance - namely for my work-in-progress JavaScript book - and in doing so have examined a number of different JavaScript classical-inheritance-simulating techniques. Out of all the ones that I've
-
01 Sep 11
-
24 Aug 11
-
23 Aug 11
-
22 Aug 11
-
19 Aug 11
-
04 Aug 11
-
didn't have any dependencies
-
extend
-
constructor
-
-
03 Aug 11
-
21 Jun 11
-
04 May 11
-
02 May 11
-
20 Apr 11
-
23 Mar 11
-
15 Mar 11
TAE HYUN KIMSimple JavaScript Inheritance
-
24 Feb 11
-
07 Feb 11
-
When you're doing inheritance, creating a class that inherits functionality from a super-class, a frequent desire is the ability to access a method that you've overridden.
-
When you're doing inheritance, creating a class that inherits functionality from a super-class, a frequent desire is the ability to access a method that you've overridden. The final result, in this particular implementation, is a new temporary method (
._super) which is only accessible from within a sub-classes' method, referencing the super-classes' associated method. -
Note that we create an anonymous closure (which returns a function) that will encapsulate the new super-enhanced method. To start we need to be a good citizen and save a reference to the old
this._super(disregarding if it actually exists) and restore it after we're done.
-
-
-
When you're doing inheritance, creating a class that inherits functionality from a super-class, a frequent desire is the ability to access a method that you've overridden. The final result, in this particular implementation, is a new temporary method (
._super) which is only accessible from within a sub-classes' method, referencing the super-classes' associated method. -
When you're doing inheritance, creating a class that inherits functionality from a super-class, a frequent desire is the ability to access a method that you've overridden.
-
Note that we create an anonymous closure (which returns a function) that will encapsulate the new super-enhanced method. To start we need to be a good citizen and save a reference to the old
this._super(disregarding if it actually exists) and restore it after we're done.
-
-
25 Jan 11
-
03 Jan 11
-
30 Dec 10
Hyung-Joo LimJohn Resig - Simple JavaScript Inheritance http://ow.ly/1aC6FF
-
27 Dec 10
-
21 Dec 10
-
11 Dec 10
avipintointeresting concept, didn't fully understand it all - should revise later and lay with it
-
01 Dec 10
-
18 Nov 10
-
28 Oct 10
-
25 Oct 10
-
27 Sep 10
-
26 Sep 10
-
01 Sep 10
-
17 Aug 10
-
09 Aug 10
-
06 Aug 10
-
14 Jul 10
-
22 Jun 10
-
18 Jun 10
-
28 May 10
-
26 Apr 10
-
22 Apr 10
-
16 Apr 10
-
11 Mar 10
-
03 Feb 10
loige loigianivar Ninja = Person.extend({
init: function(){
this._super( false );
},
dance: function(){
// Call the inherited version of dance()
return this._super();
},
swingSword: function(){
return true;
}
});javascript oop programming development js jquery howto prototype inheritance
-
02 Feb 10
-
15 Jan 10
-
27 Nov 09
-
28 Oct 09
-
08 Oct 09
-
03 Sep 09
-
27 Aug 09
-
19 Aug 09
-
12 Aug 09
-
29 Jul 09
-
23 Jul 09
-
04 Jun 09
-
19 May 09
-
07 Apr 09
-
02 Apr 09
-
04 Mar 09
-
19 Feb 09
-
13 Jan 09
john ogdenResig really knows his Javascript. This is an implementation of class-based inheritance in JS which is shorter and cleaner than Prototype's. (Doesn't support mixins directly, though.)
-
13 Dec 08
-
22 Oct 08
-
04 Oct 08
-
02 Oct 08
rampionI'd add the try / finally block specified in the comments.
-
30 Sep 08
-
10 Aug 08
-
13 Apr 08
-
08 Apr 08
-
02 Apr 08
-
26 Mar 08
-
24 Mar 08
-
23 Mar 08
-
22 Mar 08
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.