Skip to content Skip to sidebar Skip to footer

Jquery DispatchEvent Wrapper Method

Is there a wrapper method or some library for dispatchEvent in jquery? I've been looking for this on stackoverflow, but the closest method I've found is jquery's trigger(), which a

Solution 1:

The implementation of trigger in jQuery (upto 1.10.1) for custom events doesn't fire a native event and therefore you wont be able to listen for it via addEventListener or a different version of jQuery loaded on the same page.

This bug with all of its use-cases is well documented here: http://bugs.jquery.com/ticket/11047

As a solution you can use this plugin, which checks if the browser supports firing custom native events and uses it when available.

https://github.com/sandeep45/betterTrigger


Post a Comment for "Jquery DispatchEvent Wrapper Method"