2

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?

siamii
  • 23,374
  • 28
  • 93
  • 143
  • 1
    you can instruct chrome to 'break' code execution when an element is modified/attributes changed http://stackoverflow.com/questions/13334709/how-to-debug-a-specific-javascript-click-event/13335076#13335076 – lostsource Nov 14 '12 at 18:20
  • It's a bit of a non-answer, but you could always just guess. You know the element ID, and you have the [js file](http://www.mapcrunch.com/js/maps.min.js?v=14). – Jezen Thomas Nov 14 '12 at 18:23

2 Answers2

2

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.

1

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

fine
  • 98
  • 7
  • This works too. I found that enabling "Search in content scripts" option in the settings does a global search in all js files, I think. – siamii Nov 14 '12 at 18:34