Breakpoints are great when one knows where the code is being executed. Howe开发者_如何学Gover, I have a problem where my DIV is being manipulated by some unknown code in a library I'm using. Is there a way to basically set a breakpoint on the node and see when children are added or attributes changed?
In firebug you can set in the html tab "Stop on attribute change"
see : http://getfirebug.com/html
Just for people who have never used Firebug, go to the HTML tab along the top of the Firebug window, navigate to the element you are after by expanding the relevant nodes. (Alternatively right-click the div on the page, and choose "Inspect Element" at the bottom (usually) of the right-click menu. Mousing over the node should, by default, highlight that element on the page.
Then when you have the div node shown in the firebug window, right click on the node and choose "Break On Attribute Change", "Break on Child addition or Removal", "Break on Element Removal", or whichever combination you'd like. And voila!
精彩评论