Re: Window load/unload calling Object.prototype extension method.
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Tue, 07 Apr 2009 23:33:05 +0200
Zvt.Fred wrote:
When I extend the Object's prototype like this:
Object.prototype.zvt_hello = function() {
alert("Hello object! (" + this.toString() + ")");
}
var d = new Date();
d.zvt_hello();
var i = new Number();
i.zvt_hello();
I noted that zvt_hello() method is called in window.onload and
window.onunload.
I tested on FF 3.0.8 and IE 6.0.2.
Can anyone explain me why this happens?
You call it there. (That was easy.)
PointedEars
.
- Follow-Ups:
- References:
- Prev by Date: Re: Proposal: A way to assign a unique id to JS objects
- Next by Date: Re: jQuery + IE8--told you so
- Previous by thread: Window load/unload calling Object.prototype extension method.
- Next by thread: Re: Window load/unload calling Object.prototype extension method.
- Index(es):