Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. MutationObserver = window.MutationObserver || window.WebKitMutationObserver; // comment if doesn't work
  2.  
  3. var observer = new MutationObserver(function(mutations, observer) {
  4. // fired when a mutation occurs
  5. console.log(mutations, observer);
  6. // ...
  7. });
  8.  
  9. // define what element should be observed by the observer
  10. // and what types of mutations trigger the callback
  11. observer.observe(document, {
  12. subtree: true,
  13. attributes: true
  14. //...
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement