Hello all,

I recently started using jQuery in Greasemonkey scripts and am loving
it.

I have two Greasemonkey scripts running on a page. Script A adds an
element to the page and binds a mouseover handler using DOM
addEventListener method. This script is not using jQuery.

Script B wants to trigger the event on that element added by script A
using the jQuery .trigger('mouseover') method. But the event doesn't
fire.

Looking at jQuery code (1.2.1) and with the help of Firebug, I found
that .trigger('...') fires if the event handler was specified using
'on...' attributes to an element. But it doesn't fire if the event
handler was bound via addEventListener. This seems to be true whether
the element was "native" to the page or was dynamically added later by
Greasemonkey.

Is there any way I can make this work, short of merging the two
scripts (which I'd rather not do), or rewriting the script A to use
jQuery .bind() method to bind the event handler?

Thanks for your time.
/prakash

Reply via email to