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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With