3

Simple question. I would like to monitor every time a custom event ('connect") is fired.

As per How do I view events fired on an element in Chrome DevTools? and http://www.briangrinstead.com/blog/chrome-developer-tools-monitorevents, I can use MonitorEvent to monitor events in chrome. However, I am not sure if this supports custom events?

For example, I have a custom event bound by jQuery using $(document).bind('connect', function (ev, data) {//code here;});

but if I type monitorEvents($0, 'connect') into the console

I don't see any monitored events, even though the event is most definitely triggered in my code.

Thanks!

C

Community
  • 1
  • 1
hansa
  • 139
  • 2
  • 13

1 Answers1

0

monitorEvents isn't part of the jQuery library so it won't catch the bespoke events... it is part of the console object and therefore only 'sees' proper browser events. I recommend you look up how custom jQuery events work and create your own logger, at least with jQuery it's easy, just set a event listener on the document.

sidonaldson
  • 24,431
  • 10
  • 56
  • 61