siamii
siamii

Reputation: 24104

How to find where a method is called from in Chrome?

There's a website I would like to debug. http://www.mapcrunch.com/ I would like to see where the javascript hooks into the giant GO button in the middle.

So far by inspecting the element I have found this:

<button id="gobutton" class="button" style="display:none;" title="Click to go!">
   <span>Go!</span>
</button>

When I click the button, in the "Network" view, I have found that it calls. http://www.mapcrunch.com/json/rand.php?c=35&d=0 But I cannot find where the actual call is made. I want to find the function or line that makes this request. Is there a way to do that in Chrome?

Upvotes: 2

Views: 154

Answers (2)

fine
fine

Reputation: 98

Uncompress JS file from the site, and search for the #gobutton

Upvotes: 1

Patrick James McDougle
Patrick James McDougle

Reputation: 2062

Assuming the DOM gets altered on a click of the go button, you can right click on the HTML tag in the dev tools and click "Break on... Subtree modification". Then click the go button. This will pause on the javascript being executed.

Upvotes: 2

Related Questions