[Greasemonkey] GM_xmlhttpRequest and events that don't happen
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.
More information about the Greasemonkey