Call Prototype for IE Legacy

Relates to DOM Scripting and Exploder

One cautionary note I discovered when testing access to overriden methods is that IE5.01 does not recognize the call method. I had only recently started using this to inherit public access properties and methods from the constructor's prototype, mainly for asthetic reasons (and one less line of code). Well the IE fix, as performed previously with prototyping Array objects, is a new method for the Function object's prototype as follows:


if (typeof Function.prototype.call == "undefined") {
  Function.prototype.call = function(obj, param) {
    obj.base = this;
    obj.base(param);  
  }  
}

This simply acts as a wrapper for the traditional method of prototype inheritance, by calling the constructor function of the prototype, and fortunately is compatible with IE5.01.

Posted on Friday, Oct 08, 2004 at 03:47:21.

Comments on Call Prototype for IE Legacy (0)

Breadcrumbs Trail

[ Home ] -> TW Blog -> Oct 04 -> Call Prototype for IE Legacy
Site Map

The Severn Solutions website achieves the following standards:

[ XHTML 1.0 ] [ CSS 2 ] [ WAI AA ] [ Bobby AA ]

Page compiled in 0.029 seconds