HTML5 includes a concept of \"mutation observers\" to monitor changes to the browser\'s DOM.
Your observer callback will be passed data which looks a lot like DOM tr
I don't have any personal code snippets for this one, but I have three resources that may help:
Example from link #3 'jquery-mutation-summary' library:
// Use document to listen to all events on the page (you might want to be more specific)
var $observerSummaryRoot = $(document);
// Simplest callback, just logging to the console
function callback(summaries){
console.log(summaries);
}
// Connect mutation-summary
$observerSummaryRoot.mutationSummary("connect", callback, [{ all: true }]);
// Do something to trigger mutationSummary
$("", { href: "http://joelpurra.github.com/jquery-mutation-summary"}).text("Go to the jquery-mutation-summary website").appendTo("body");
// Disconnect when done listening
$observerSummaryRoot.mutationSummary("disconnect");