How do I find out where (line number or location) a piece of javascript is changing a specific piece of content in html?
Here it the crux of the issue:
Imagine 3 Div's. Each gets its content via ajax on page load. Each of the divs receives its own html and javascript and jquery. The content of one of the divs is being modified by javascript after it loads, by code that is not part of that div's code. (One of the other divs is making the change.) I need to locate the code that is making the change. (In reality I am working with 12 div's... but I used 3 just to make the example...)
Normally I would just run firebug and watch the code execution... but as this is all dynamically loaded, I am having trouble locating WHERE this is happeni开发者_Python百科ng at. I have performed simple searches for the ID's and classes involved, but have found no conflicting points yet. Any ideas, help, or tutorials would be appreciated.
If you use Chrome, you can inspect the DIV in question (right-click, choose "inspect element") and then right-click the element in the elements source tree and choose "Break on Subtree Modifications" and or "Break on Attributes Modifications".
This will cause a breakpoint when the changes occur and you'll be able to inspect the call stack to find the offending call.
精彩评论