Skip to content

Instantly share code, notes, and snippets.

@citylims
Created October 20, 2015 18:24
Show Gist options
  • Save citylims/f6033cdffcd534cb04b9 to your computer and use it in GitHub Desktop.
Save citylims/f6033cdffcd534cb04b9 to your computer and use it in GitHub Desktop.
DOM Mutation Observer.
MutationObserver = window.WebKitMutationObserver;
var observer = new MutationObserver(function(mutations, observer) {
console.log(mutations, observer);
foo()
});
observer.observe(document, {
subtree: true,
childList: true,
attribute: false
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment