I'm currently working on a tool that examines accessibility issues
pertaining to client websites and would like to add jQuery event
handling as part of our automatic analysis. One of our rules accounts
for having a tabIndex property associated with elements on the page that
have an assigned click handler in order to ensure that the elements are
also keyboard accessible.
Given an HTMLElement, you can use the $._data method to access the
event handlers that are associated with said element, which allows for
us to do those check programmatically.
My concern is with the deprecation comment on line 3738 of
jQuery-2.1.4.js as it looks like access to the event queue in jQuery
is going to be fully private sometime in the future. Is there an
alternative way to access the event queue from a public accessor
because deprecating and removing access to the data_priv member
property will halt any analysis we can provide.
Or alternatively, is there a more appropriate channel to ask this question?
The concern we have with use of the event data is that it's an
internal data structure. It has changed several times over the years, is
undocumented, and may change in future versions without advance notice.
And yes, it might even disappear. If you are okay with those rules and
are using the data mainly for debugging or diagnostic purposes, you can
use it at your risk.
The nightmare scenario for us would be that some high-profile
plugin or site started using this data in a way that prevented us from
making important changes or optimizations.
Leave a comment on dave.methvin's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic