Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript functions called in Chrome

While debugging a site, is there any way to have a stack-trace-like thing in order to have a view of all the functions called? For example, to know what happens when I click on a link?

I know some function is called but I don't know which.

like image 926
pistacchio Avatar asked Jan 20 '12 06:01

pistacchio


People also ask

Where is JavaScript function in Chrome?

To find the JavaScript function definition in Google Chrome, open the web browser and press F12 to reach Developer Tools. Search for function and that's it.

How do you call JavaScript in Chrome?

In that case, you can open a Sources tab, locate your . js file, place a breakpoint anywhere at the bottom of the outer function (you might need to refresh a page after that if the code have already been run) and call yourFunction() in console. Also, while at breakpoint you may do something like window.


1 Answers

Go to scripts tab in google chrome developer tools and set an Event Listener Breakpoint to a click event (or whatever) and click upvote. It will then stop execution right away and you may manually walk through the whole execution process, function by function.

like image 52
Esailija Avatar answered Nov 02 '22 01:11

Esailija