Advertisement
Guest User

Untitled

a guest
May 25th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. var targetNode = document.body;
  2.  
  3. var observer = new MutationObserver(mutationObjectCallback);
  4.  
  5. var observerConfig = {
  6. attributes: true,
  7. childList: true,
  8. characterData: true
  9. };
  10.  
  11. observer.observe(targetNode, observerConfig);
  12.  
  13. function mutationObjectCallback(mutations) {
  14. mutations.forEach(function(mutation) {
  15. console.log(mutation);
  16. });
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement