[TYPO3-core] RFC: fix bugs #3655 and #4701 - no wrappers for certain events
Oliver Hader
oh at inpublica.de
Sat Feb 3 18:56:52 CET 2007
Hi Masi,
Martin Kutschker wrote:
> But after writing I was wondering if the events are applied correctly
> (window vs. document vs document.body). Plus there is the issue of the
> old codes questionable behaviour of setting both an onload-attribute
> and an event property.
>
> What do you think?
>
> Masi
First of all: Good idea! ;-)
I tested the functionality in frontend with onload and onkeydown events.
Firefox2 works like a charm, IE7 doesn't!
It depends on how the events are triggered. document.on[something] might
work in some case but doesn't in all. There are browser dependent
functions which allow to register events:
element.addEventListener(eventname, observerfunc, useCapture) for Geckos
- the eventname is without the leading "on", so "keydown" instead of
"onkeydown"
-> eg: element.addEventListener('keydown', function() {...}, false);
element.attachEvent(eventname, observer) for Internet Explorer
-> eg: element.attachEvent('onkeydown', function() {...})
prototype.js includes event handling functions like Event.observe(...)
which also behaves like described above.
olly
More information about the TYPO3-team-core
mailing list