Wednesday 19 December 2018

jquery - Get all event listeners that are on an object in javascript

One tricky way is to use jQuery's internal function _data() to get these :


var element = document.querySelector('#its-your-thing'),
list_of_events = $._data(element, "events");

Careful thought, I do not have information about its behavior across versions (working at least in 1.9.0)

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...