0

So the scenario is: there are a lot of javascript code in a page. If I click a button, it will trigger a certain piece of the code. But I'm not the author of the page so I don't know which file contains that piece nor which function. Is there a way to set such a breakpoint so that I can check the code when it gets executed?

EDIT: Thanks for the comments. I found where exactly my problem was. That page calls a method in a library every second so chrome always steps in that method instead of what I really want, which confused me as I thought it wasn't debugging the code correctly. To solve that I asked chrome to ignore the code in that library. That is a experimental feature in chrome for now. This article describes the way to achieve that: http://www.divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/

4

1 Answer 1

2

What you are looking for are Event Listener Breakpoints. In Chrome Developer Tools you can find them on the Sources tab.

Link curtesy of @FelixKling.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm not sure if this question is about Google Chrome, though: the question doesn't specify any browser.
From getfirebug.com/doc/breakpoints/demo.html#event : Breakpoints on Event Handlers - This feature not yet implemented. Doing development mostly in Chrome i haven't had as much experience with other environments. Feel free to provide a better answer regarding those.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.