views:

38

answers:

2

Breakpoints are great when one knows where the code is being executed. However, 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?

+4  A: 

In firebug you can set in the html tab "Stop on attribute change"

see : http://getfirebug.com/html

remi bourgarel
+2  A: 

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!

Psytronic
Thanks. Also had to click the pause button on the script tag. I've been using Firebug for a long time but it seems there are always new things to learn about it. Thanks.
Mr Rogers
The only problem I found with the "Pause On Next" button is that if you have a mouse listener event going on, which some pages do. It will trigger as soon as you move the mouse, which is not exactly what you want to have happen. However as long as this doesn't affect you, it shouldn't matter.
Psytronic