How can my JavaScript detect if an event is available?
I'm aware of some great event-compatibility tables, but I need to use feature detection, not browser-sniffing plus a lookup table.
Specifically, my JS makes great use of the DOM mutation events (DOMNodeInserted
and DOMSubtreeModified
) -- which work great in all browsers except (of course) Internet Explorer.
So, how would I detect if a browser supports DOMNodeInserted
?