Or... http://www.howtocreate.co.uk/tutorials/javascript/domevents
Check the last part: "Manually firing events".

That should work too, if you get the element using jQuery, don't
forget to use .get(0).

Ariel Flesler

On Nov 15, 4:30 pm, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> The best approach will be to just use jQuery to bind the method if you
> want to trigger that event.
>
> --
> Brandon Aaron
>
> On Nov 15, 11:49 am, prakash <[EMAIL PROTECTED]> wrote:
>
>
>
> > 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- Hide quoted text -
>
> - Show quoted text -

Reply via email to