IE passes event object to handler / Flanagan's blog

P

Peter Michaux

Hi,

It seems there is a long standing belief that in IE does not pass the
event object to the handler functions attached with attachevent() to a
DOM element. Coincidently, I was confused about a week ago by the fact
that an event object is, in fact, passed to the handler but I didn't
investigate this further. Now David Flanagan is organizing and effort
to figure out what is going on and where this belief came from. Perhaps
someone here knows what's going on and could head over to his blog and
explain the situation.

<URL http://www.davidflanagan.com>

Thank you,
Peter
 
V

VK

It seems there is a long standing belief that in IE does not pass the
event object to the handler functions attached with attachevent() to a
DOM element.

The really long standing allusion on the matter is that attachEvent is
a buggy implemented equivalent of addEventListener so everyone is
trying to analyse it from this position.
In fact attachEvent and addEventListener are what I would call (as a
joke term) "homofuncs" by analogy with homophones.
Homophones are words that are pronounced alike even if they differ in
spelling, meaning, or origin, such as "pair" and "pear".
"Homofuncs" would be then programming entities from different
environments that are producing seemly similar results in some
particular usage despite they differ in their nature and real purpose.

This post explains it in details and with samples:
<http://groups.google.com/group/comp.lang.javascript/msg/78281e500f55079c>

The explanation to the attachEvent "argument" is that it is trying to
jump on the bound method in the global context of its behavior, but
there are neither first nor second so it's just a "poor lost baby".

I don't think that we should report it to Flanagan though you are
welcome to. Over years it became a well-established tradition to talk
about badly broken attachEvent method on IE. Maybe just keep it "entre
nous"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top