Gregory Hill
2006-Jun-15 20:00 UTC
RE: Yahoo!-like Event objectemulation/abstractioninPrototype?
> Hehe thanks for putting so much work into this, but to me it certainly > begs my original question. Any chance of making "e" work the same in > FF and IE?You''re missing the point. The ''e'' object in IE and Firefox has different functions for getting at different things. The Yahoo toolkit does not do that for you either. In their toolkit, you have to call YAHOO.util.Event.xxxx instead of Event.xxxx in prototype. Either way, you have to do something to get at event information in a non-browser-specific sort of way. Yahoo goes one step further and passes the element in to the function, so you avoid having to call the equivalent of prototype''s Event.element(e); but to get at any other information (target, x/y position, etc) you have to use one or the other API. It all goes back to the W3C wanting to say a big F*** YOU to Microsoft and implementing event handling in a totally different way than any of the old browsers had, including Netscape and IE. And MS just kept their simple version intact, while the rest of the browsers went ahead and did the w3c model (Opera supports both, AFAIK). Having said all that, somebody *could* implement something like what you want, but it would take some work. You''d have to create a class that implemented all of the functions of both event models, and create an object of that class in the bindAsEventListener method, and pass it along to the function. Sounds like an interesting theoretical exercise, I might tinker with it a bit to avoid working on the lame project I have at the moment. Greg
Maybe Matching Threads
- RE: Yahoo!-like Eventobjectemulation/abstractioninPrototype?
- RE: Yahoo!-like Event object emulation/abstractioninPrototype?
- RE: Yahoo!-like Event object emulation/abstractionin Prototype?
- RE: Yahoo!-likeEventobjectemulation/abstractioninPrototype?
- Event.observe on IE