Sunday 26 November 2017

How to find event listeners on a DOM node when debugging or from the JavaScript code?

itemprop="text">


I have a page where some
event listeners are attached to input boxes and select boxes. Is there a way to find out
which event listeners are observing a particular DOM node and for what
event?



Events are attached
using:




  1. href="http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework"
    rel="noreferrer">Prototype's
    Event.observe;

  2. DOM's
    addEventListener;

  3. As element
    attribute
    element.onclick.




Answer




If you just need to inspect what's happening
on a page, you might try the href="http://www.sprymedia.co.uk/article/Visual+Event" rel="noreferrer">Visual
Event
bookmarklet.



Update:
rel="noreferrer">Visual Event 2 available;



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...