14

I'm using Firefox. Is there something out there that will show me all the JavaScript events that are getting triggered in real time?

lulalala
  • 17,572
  • 15
  • 110
  • 169
7wp
  • 12,505
  • 20
  • 77
  • 103
  • Such a listing would be polluted with a million mouse events that you probably don't care about. – mikerobi Nov 03 '10 at 17:00
  • @mikerobi normally no i would not care. But I need to debug some event issues where they are firing in different orders. Therefore I do need to see them all in this case. – 7wp Nov 03 '10 at 17:05

2 Answers2

15

You can right-click an element in Firebug's HTML tab and click Log Events.

You will then see every event received by that element in the Console tab.
You can even click one of them to explore the properties of the event object.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • 1
    That's a great tip, but... Unfortunately, the 'Log Events' setting does not 'stick' to that element, which makes it impossible to log events that happen while (or directly after) the page is loading. Does anyone know a way log those events as well? – marcvangend Jul 06 '11 at 09:33
  • 1
    @marcvangend: Set a Javascript breakpoint somewhere that will trigger before the events fire, then click Log events. – SLaks Aug 04 '13 at 22:29
3

I have been using Visual Event for a few years now. It's a simple bookmarklet, meaning you just have to drag it into your bookmarks, and then click it while on your page to visually highlight all javascript events. You can also trigger the events at will, and probably a whole lot more. It's very easy and intuitive to use, and perfect to quickly find what you're looking for. Give it a try:

https://github.com/DataTables/VisualEvent

Jort
  • 1,401
  • 8
  • 23
  • 39
  • Two different versions of Visual Event exist. I always keep both of them in the bookmark: [v1](http://sprymedia.co.uk/article/Visual+Event), [v2](http://sprymedia.co.uk/article/Visual+Event+2) – Pino Jan 12 '16 at 09:39