[Greasemonkey] GM_xmlhttpRequest and events that don't happen right away...

Mark Pilgrim pilgrim at gmail.com
Fri Aug 12 15:03:10 EDT 2005


On 8/12/05, Brad Maness <brad.maness at gmail.com> wrote:
> What I was looking for was a cross-implimented example. I'm sure that
> works fantastic in GM/Fx, but it doesn't work in Turnabout/IE.
> 
> ... and yes, I've changed :
> > elm.addEventListener('click', clickHandler, true);
> ... to :
> > elm.attachEvent('onclick', clickHandler);

IE's event model is totally different than Firefox.  Onclick handlers
don't get the event as an argument; instead, you need to use
window.event.  Also, you can't return values from an event handler,
you need to set some property on window.event.  And you don't call
preventDefault() either.  And lots of other stuff.  Lots and lots.

Start here:

http://www.quirksmode.org/js/introevents.html
http://www.quirksmode.org/js/events_compinfo.html
http://www.quirksmode.org/js/events_properties.html
http://www.quirksmode.org/js/events_order.html
http://www.quirksmode.org/js/events_mouse.html
http://www.quirksmode.org/dom/w3c_events.html

-- 
Cheers,
-Mark


More information about the Greasemonkey mailing list