Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
178
rated 0 times [  181] [ 3]  / answers: 1 / hits: 24673  / 12 Years ago, tue, june 19, 2012, 12:00:00

Is there a way to find out which Javascript function is fired by click on a certain button?


Let me explain ...

I have a web page with a large js script (not made ​​by me), I've to detect which function is triggered by a specific button, I need to find the function triggered by this button.


More From » dom-events

 Answers
8

Use Chrome's Web Inspector to inspect the element and check out the Event Listeners panel.



Web



If the code attaching the event is in a library (for example, by Zepto in my example), set a breakpoint on the line and examine the call stack to see where it originated in your code.



Call



As you can see, the event has originated in my code and now I know the filename and line number.


[#84813] Monday, June 18, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
natalyah

Total Points: 371
Total Questions: 90
Total Answers: 105

Location: The Bahamas
Member since Wed, Apr 12, 2023
1 Year ago
;