Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the snippet of JavaScript that modifies an element?

The page I'm trying inspect has a hidden <input type="hidden" name="Foo" value="123 /> element on a page, where Javascript/AJAX modifies the value. I'm trying to find where on earth in Javascript is the code that modifies this value from time to time.

Is there a tool that could help me find the places in javascript that use/modify that element? Does Firebug provide this, if so, how?

Note: If tried looking for "Foo" in the code, but I haven't found any matching titles. There's JSON and Mootools loaded, +application specific code, which results several thousands lines of code. The element is probably accessed indirectly.

like image 482
AmericanDad Avatar asked Oct 26 '09 02:10

AmericanDad


1 Answers

Firebug 1.5 will have "Break-on-Modify" on the HTML panel. See http://getfirebug.com/doc/breakpoints/demo.html#html - Break on DOM (HTML) Mutation Events.

like image 80
robcee Avatar answered Oct 21 '22 14:10

robcee