How do I know which script is running in a particular HTML element?

6

In Firebug it is possible to know which CSS is being applied in the HTML element, but it is not possible to know which JavaScript is running in the HTML element, how can I know this?

    
asked by anonymous 24.10.2014 / 18:31

2 answers

3

You can find out which events have been attached to a DOM object via Firebug since version 1.12, where the getEventListeners(target) (English) :

  • Open Firebug for example with the F12
  • Click on the console ;
  • Type in the command line by passing a DOM object as a parameter.

    Example to collect events attached to tag <body/> :

    getEventListeners(document.body);
    

    The result will be something like:

  • Notes:

    It does not seem to work with jQuery objects, you should make use of "normal" DOM objects.

    You should expect the page to be fully loaded to ensure the DOM has been fully read and is ready to be searched by getEventListeners() .

        
    24.10.2014 / 20:16
    1

    If you are using jQuery, there is a plugin for firefox that lets you know which function is attached to an html element. The name of the plugin is FireQuery .

        
    24.10.2014 / 19:59