JS Is there a way to check if an event exists?

I am trying to determine if any webkit event is supported by the ' webkitAnimationEnd ' by the browser, to do this, I like to check if the event exists. But I can’t figure out how to do this. Somebody knows?

+7
source share
2 answers

Detecting event support without hacking the browser suggests that this should work:

 'onWebkitAnimationEnd' in document.createElement('div'); 
+7
source

What does "supported" mean? Assuming that you mean "It will be fired by the browser under certain circumstances," you just need to recreate these circumstances (via a script) and see if the event was fired; you can use a timeout handler to respond negative if the event has never been handled.

Detect functions by checking them, and not look elsewhere.

-3
source

All Articles