Is there a way to detect what event handlers are available natively for an HTML element?
For example:
isAvailable(img.onload) === true; // All browsers
isAvailable(script.onload) === true; // Non-IE only (Webkit, Firefox, Opera)
isAvailable(link.onload) === true; // IE (and I think Opera) only
Ideally I want to do feature detection in my script, where if onload is available for an element to use that, otherwise fallback. Currently I am having to do browser forks (based on IE) which is annoying as IE may start supporting script.onload, and Webkit/Firefox may start supporting link.onload.
Unfortunately assigning element.onload makes the event no longer 'undefined', regardless of whether it will eventually fire or not.
Thanks!