Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to determine which JavaScript events are being triggered

As the title says, how can I find what JavaScript events are being triggered as I interact with a webpage?

like image 667
hoju Avatar asked Jan 21 '10 12:01

hoju


People also ask

How can you tell if a event is triggered?

Open Google Chrome and press F12 to open Dev Tools. Go to Event Listener Breakpoints, on the right: Click on the events and interact with the target element.

What is triggering event in JavaScript?

Some common HTML events are as follows: onload: It is triggered when the browser completes loading a page. onchange: It is triggered when an HTML element changes. onclick: It is triggered when an HTML element is clicked. onmouseover: It is triggered when the mouse is moved over a HTML element.

How do I see events in inspect element?

Right-click on the search icon button and choose “inspect” to open the Chrome developer tools. Once the dev tools are open, switch to the “Event Listeners” tab and you will see all the event listeners bound to the element. You can expand any event listener by clicking the right-pointing arrowhead.


1 Answers

when you have firebug installed, the following functions will gather data of all the javascript functions being triggered, and how much time is spent executing them:

console.profile([title])

Turns on the JavaScript profiler. The optional argument title would contain the text to be printed in the header of the profile report.

console.profileEnd()

Turns off the JavaScript profiler and prints its report.

More info can be found at http://getfirebug.com/console.html

like image 131
Jasper De Bruijn Avatar answered Nov 09 '22 22:11

Jasper De Bruijn