0

I am searching for a way to get notified when a js is changing/mutating the page's DOM, and know which js caused the change. How can I achieve this? Is there a way to do so using Java? In JavaScript? Any other way? Thanks, Inbar.

Blondy314
  • 751
  • 9
  • 24
  • hm ... i could manipulate such a script as well. then it would be useless. for what reason you would like to know this. maybe there is a better way of avoiding your problem. if it is only your js which you would like to track, just log what u are doing.. – helle May 13 '11 at 09:16
  • Do you want this in order to debug a script or in order to implement some functionality? This type of debugging is build into both firebug and webkits javascript debugger. – wewals May 13 '11 at 09:32
  • possible duplicate of [Detect changes in the DOM](http://stackoverflow.com/questions/3219758/detect-changes-in-the-dom) – Yi Jiang May 13 '11 at 12:56

1 Answers1

0

You want to add an event listener to listen for Mutation events.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents

Update: I see from other answers that there might be problems with IE support. See Detect changes in the DOM

Community
  • 1
  • 1
Matthew Wilson
  • 3,861
  • 21
  • 14