Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
183
rated 0 times [  189] [ 6]  / answers: 1 / hits: 22187  / 10 Years ago, fri, february 28, 2014, 12:00:00

I'm using Chrome DevTools to debug JavaScript. In my script I bound a click event to an element using the jQuery bind() method.
How to check if that event was fired or not?



Edit

Sorry because I wasn't so specific, I know that I can use console.log() or set a breakpoint inside the event listener body. What I'm talking about here is an out of box feature of the Chrome DevTools that allows you to check that without using the console, e.g a tab that contains all the events that were fired with related information.


More From » jquery

 Answers
7

Regarding Chrome, checkout the monitorEvents() via the command line API.




  • Open the console via Menu > Tools > JavaScript Console.

  • Enter monitorEvents(window);

  • View the console flooded with events



    ...
    mousemove MouseEvent {dataTransfer: ...}
    mouseout MouseEvent {dataTransfer: ...}
    mouseover MouseEvent {dataTransfer: ...}
    change Event {clipboardData: ...}
    ...



There are other examples in the documentation. I'm guessing this feature was added after the previous answer.


[#72248] Thursday, February 27, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deannaalysonl

Total Points: 703
Total Questions: 101
Total Answers: 115

Location: Saint Helena
Member since Tue, Nov 3, 2020
4 Years ago
;