Is there any "on DOM change" event? [duplicate]
Solution 1:
DOM mutation events (I believe not supported in all browsers) .. see http://en.wikipedia.org/wiki/DOM_events#Common.2FW3C_events
Solution 2:
I don't think so there is any such event across all the browsers. I would go with a custom event and trigger it whenever I manipulate the dom.
//Subscribe to domChanged event
$(document).bind('domChanged', function(){
alert('Dom changed');
});
//Trigger the domChanged event
$(document).trigger('domChanged');