Netscape 6, Part VI: Object-Oriented DOCJSLIB 1.2

Browser-Independent Superclass

The superclass of DOCJSLIB 1.2 includes a single method, makeImage. This method is common to all browsers, so there is no need to duplicate this method in all browser-dependent subclasses. All subclasses inherit their superclass' methods. In our case, they all inherit this single method, makeImage. They don't need, of course, to override it, because it is browser-independent. To define a method of an object, you first assign its name to a function name:

this.makeImage = makeImageMethod;

Notice that the method name, makeImage, does not necessarily need to be identical to the function name, makeImageMethod. You then have to define the function: